19 |
my $config; |
my $config; |
20 |
|
|
21 |
use index_DBI; # there is no other, right now ;-) |
use index_DBI; # there is no other, right now ;-) |
22 |
|
my $index; |
|
my $index = new index_DBI(); # open index |
|
23 |
|
|
24 |
my %opts; |
my %opts; |
25 |
|
|
213 |
|
|
214 |
my $cfg = new Config::IniFiles( -file => $config_file ); |
my $cfg = new Config::IniFiles( -file => $config_file ); |
215 |
|
|
216 |
|
# open index |
217 |
|
$index = new index_DBI( |
218 |
|
$cfg->val('global', 'dbi_dbd'), |
219 |
|
$cfg->val('global', 'dbi_dsn'), |
220 |
|
$cfg->val('global', 'dbi_user'), |
221 |
|
$cfg->val('global', 'dbi_passwd') || '', |
222 |
|
); |
223 |
|
|
224 |
|
# delete [global] section to leave just databases sections |
225 |
|
$cfg->DeleteSection('global'); |
226 |
|
|
227 |
foreach my $database ($cfg->Sections) { |
foreach my $database ($cfg->Sections) { |
228 |
|
|
229 |
my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!"; |
my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!"; |
264 |
|
|
265 |
my $swishpath = $path."#".int($row->{mfn}); |
my $swishpath = $path."#".int($row->{mfn}); |
266 |
|
|
267 |
if (my $xml = $cp2utf->convert(isis2xml($row,$add_xml."<path>$swishpath</path>"))) { |
if (my $xml = isis2xml($row,$add_xml)) { |
268 |
|
$xml = $cp2utf->convert($xml); |
269 |
use bytes; # as opposed to chars |
use bytes; # as opposed to chars |
270 |
print "Path-Name: $swishpath\n"; |
print "Path-Name: $swishpath\n"; |
271 |
print "Content-Length: ".(length($xml)+1)."\n"; |
print "Content-Length: ".(length($xml)+1)."\n"; |