Added extra parameter in parse_plugin_cfg

This is used when no parsing of the values is required.
E.g. when values are folder names with special characters
This commit is contained in:
bergware
2018-08-27 17:10:48 +02:00
parent 72839bccf2
commit 54b8d4d822

View File

@@ -14,12 +14,12 @@
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
// Wrapper functions
function parse_plugin_cfg($plugin, $sections=false) {
function parse_plugin_cfg($plugin, $sections=false, $scanner=INI_SCANNER_NORMAL) {
global $docroot;
$ram = "$docroot/plugins/$plugin/default.cfg";
$rom = "/boot/config/plugins/$plugin/$plugin.cfg";
$cfg = file_exists($ram) ? parse_ini_file($ram, $sections) : [];
return file_exists($rom) ? array_replace_recursive($cfg, parse_ini_file($rom, $sections)) : $cfg;
$cfg = file_exists($ram) ? parse_ini_file($ram, $sections, $scanner) : [];
return file_exists($rom) ? array_replace_recursive($cfg, parse_ini_file($rom, $sections, $scanner)) : $cfg;
}
function parse_cron_cfg($plugin, $job, $text = "") {
$cron = "/boot/config/plugins/$plugin/$job.cron";