Changeset 17381 for trunk/DataStoreServer/scripts/dsfsindex
- Timestamp:
- Apr 7, 2008, 3:59:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/DataStoreServer/scripts/dsfsindex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStoreServer/scripts/dsfsindex
r16954 r17381 8 8 use warnings; 9 9 10 use dsdbh; 10 11 use DBI; 11 12 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 ); 13 my $PS_EXIT_CONFIG_ERROR = 3; 14 my $PS_EXIT_DATA_ERROR = 5; 23 15 24 16 my $fileset = pop; … … 114 106 print "$line\n"; 115 107 } 116 117 sub getDBHandle {118 my $ipprc = PS::IPP::Config->new(); # IPP Configuration119 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.
