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/dsfsindex

    r16954 r17381  
    88use warnings;
    99
     10use dsdbh;
    1011use DBI;
    1112
    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                        );
     13my $PS_EXIT_CONFIG_ERROR = 3;
     14my $PS_EXIT_DATA_ERROR = 5;
    2315
    2416my $fileset = pop;
     
    114106    print "$line\n";
    115107}
    116 
    117 sub getDBHandle {
    118     my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
    119     my $siteConfig = $ipprc->{_siteConfig};
    120 
    121     my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
    122     my $dbname   = metadataLookupStr($siteConfig, 'DBNAME');
    123     my $dbuser   = metadataLookupStr($siteConfig, 'DBUSER');
    124     my $dbpass   = metadataLookupStr($siteConfig, 'DBPASSWORD');
    125     exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass;
    126 
    127     my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";
    128 
    129     my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";
    130     return $dbh;
    131 }
Note: See TracChangeset for help on using the changeset viewer.