mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'pandora_server-no-se-reinicia-al-cambiar-conf-remota' into 'develop'
Set @Parser::Expat::Encoding_Path instead of calling load_encoding. See merge request !865
This commit is contained in:
commit
e18a3bbe36
@ -73,26 +73,8 @@ sub new ($$;$) {
|
|||||||
my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh);
|
my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh);
|
||||||
|
|
||||||
# Load external .enc files for XML::Parser.
|
# Load external .enc files for XML::Parser.
|
||||||
if ($config->{'enc_dir'} ne '') {
|
if ($config->{'enc_dir'} ne '' && !grep {$_ eq $config->{'enc_dir'}} @XML::Parser::Expat::Encoding_Path) {
|
||||||
if (opendir(my $dh, $config->{'enc_dir'})) {
|
push(@XML::Parser::Expat::Encoding_Path, $config->{'enc_dir'});
|
||||||
while (my $enc_file = readdir($dh)) {
|
|
||||||
|
|
||||||
# Ignore unknown files.
|
|
||||||
next unless ($enc_file =~ m/.enc$/);
|
|
||||||
|
|
||||||
# Load the .enc file.
|
|
||||||
eval {
|
|
||||||
local $SIG{__DIE__} = {};
|
|
||||||
XML::Parser::Expat::load_encoding($config->{'enc_dir'} . '/' . $enc_file);
|
|
||||||
};
|
|
||||||
if ($@) {
|
|
||||||
print_message ($config, " [WARNING] Error loading encoding file: $enc_file", 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($dh);
|
|
||||||
} else {
|
|
||||||
print_message($config, " [WARNING] Error opening directory " . $config->{'enc_dir'} . ": $!", 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user