mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
Config::fromIni(): use IniParser::parseIniFile() instead of parse_ini_file()
refs #10150
This commit is contained in:
parent
acb93ce1ae
commit
626c3494e4
@ -12,6 +12,7 @@ use Icinga\Data\ConfigObject;
|
|||||||
use Icinga\Data\Selectable;
|
use Icinga\Data\Selectable;
|
||||||
use Icinga\Data\SimpleQuery;
|
use Icinga\Data\SimpleQuery;
|
||||||
use Icinga\File\Ini\IniWriter;
|
use Icinga\File\Ini\IniWriter;
|
||||||
|
use Icinga\File\Ini\IniParser;
|
||||||
use Icinga\Exception\NotReadableError;
|
use Icinga\Exception\NotReadableError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -313,7 +314,7 @@ class Config implements Countable, Iterator, Selectable
|
|||||||
if ($filepath === false) {
|
if ($filepath === false) {
|
||||||
$emptyConfig->setConfigFile($file);
|
$emptyConfig->setConfigFile($file);
|
||||||
} elseif (is_readable($filepath)) {
|
} elseif (is_readable($filepath)) {
|
||||||
$config = new static(new ConfigObject(parse_ini_file($filepath, true)));
|
$config = static::fromArray(IniParser::parseIniFile($filepath)->toArray());
|
||||||
$config->setConfigFile($filepath);
|
$config->setConfigFile($filepath);
|
||||||
return $config;
|
return $config;
|
||||||
} elseif (@file_exists($filepath)) {
|
} elseif (@file_exists($filepath)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user