it lives!!!!
This commit is contained in:
parent
00644808a1
commit
8950b951bc
4 changed files with 72 additions and 10 deletions
|
|
@ -186,16 +186,20 @@ sub new {
|
|||
return $config{$filename};
|
||||
} else {
|
||||
my $json = "";
|
||||
open(FILE,"<".$webguiPath.'/etc/'.$filename);
|
||||
while (my $line = <FILE>) {
|
||||
$json .= $line unless ($line =~ /^\s*#/);
|
||||
if (open(FILE,"<".$webguiPath.'/etc/'.$filename)) {
|
||||
while (my $line = <FILE>) {
|
||||
$json .= $line unless ($line =~ /^\s*#/);
|
||||
}
|
||||
close(FILE);
|
||||
my $conf = jsonToObj($json);
|
||||
my $self = {_webguiRoot=>$webguiPath, _configFile=>$filename, _config=>$conf};
|
||||
bless $self, $class;
|
||||
$config{$filename} = $self unless $noCache;
|
||||
return $self;
|
||||
} else {
|
||||
warn "Cannot open config file: ".$filename;
|
||||
return undef;
|
||||
}
|
||||
close(FILE);
|
||||
my $conf = jsonToObj($json);
|
||||
my $self = {_webguiRoot=>$webguiPath, _configFile=>$filename, _config=>$conf};
|
||||
bless $self, $class;
|
||||
$config{$filename} = $self unless $noCache;
|
||||
return $self;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue