upgrade.pl and testEnvironment.pl now use the same config file reader as

the rest of WebGUI
This commit is contained in:
JT Smith 2005-03-31 21:22:57 +00:00
parent ddc63b91b3
commit 4e6e41ce2c
5 changed files with 108 additions and 108 deletions

View file

@ -84,16 +84,43 @@ The path to the WebGUI installation.
=cut
sub loadAllConfigs {
my $webguiPath = shift;
my $configs = readAllConfigs($webguiPath);
foreach my $filename (keys %{$configs}) {
unless ($filename =~ /^demo\d/) {
print "\tLoading ".$filename."\n";
$config{$filename} = $configs->{$filename};
}
}
}
#-------------------------------------------------------------------
=head2 readAllConfigs ( webguiRoot )
Reads all the config file data for all defined sites and returns a hash reference containing the resulting data by config file name.
Example: $configs->{$filename};
=head3 webguiRoot
The path to the WebGUI installation.
=cut
sub readAllConfigs {
my $webguiPath = shift;
opendir(DIR,$webguiPath."/etc");
my @files = readdir(DIR);
closedir(DIR);
my %configs;
foreach my $file (@files) {
if ($file =~ /\.conf$/ && !($file =~ /^demo\d/)) {
print "\tLoading ".$file."\n";
$config{$file} = readConfig($webguiPath,$file);
if ($file =~ /\.conf$/ && !($file =~ /^logs.conf$/)) {
$configs{$file} = readConfig($webguiPath,$file);
}
}
return \%configs;
}

View file

@ -15,6 +15,7 @@ package WebGUI::ErrorHandler;
=cut
use FileHandle;
use Log::Log4perl;
use strict;
use WebGUI::Session;