IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 7, 2008, 3:59:25 PM (18 years ago)
Author:
bills
Message:

Allow the data store server to be installed without a full IPP installation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStoreServer/scripts/dsrootindex

    r16762 r17381  
    88use warnings;
    99
     10use dsdbh;
     11
    1012use DBI;
    1113
    12 use PS::IPP::Config qw($PS_EXIT_SUCCESS
    13                        $PS_EXIT_UNKNOWN_ERROR
    14                        $PS_EXIT_SYS_ERROR
    15                        $PS_EXIT_CONFIG_ERROR
    16                        $PS_EXIT_PROG_ERROR
    17                        $PS_EXIT_DATA_ERROR
    18                        $PS_EXIT_TIMEOUT_ERROR
    19                        metadataLookupStr
    20                        metadataLookupBool
    21                        caturi
    22                        );
     14my $PS_EXIT_CONFIG_ERROR = 3;
    2315
    2416my $dbh = getDBHandle();
     
    4638    print $line;
    4739}
    48 
    49 # todo move to a module
    50 sub getDBHandle {
    51     my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
    52     my $siteConfig = $ipprc->{_siteConfig};
    53 
    54     my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
    55     my $dbname   = metadataLookupStr($siteConfig, 'DBNAME');
    56     my $dbuser   = metadataLookupStr($siteConfig, 'DBUSER');
    57     my $dbpass   = metadataLookupStr($siteConfig, 'DBPASSWORD');
    58     exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass;
    59 
    60     my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";
    61 
    62     my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";
    63     return $dbh;
    64 }
Note: See TracChangeset for help on using the changeset viewer.