mirror of
https://github.com/unraid/webgui.git
synced 2026-03-13 14:30:29 -05:00
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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user