This commit is contained in:
Namhyeon Go 2018-12-18 12:24:15 +09:00
parent f95edce268
commit 98516736ef
2 changed files with 13 additions and 3 deletions

View File

@ -12,8 +12,18 @@ if(!function_exists("read_config")) {
$files = retrieve_storage_files("config");
foreach($files as $file) {
$ini = array();
if(check_file_extension($file, "ini.php", array("multiple" => true))) {
$ini = parse_ini_file(include($file));
$ini = parse_ini_string(include($file));
} elseif(check_file_extension($file, "config.php", array("multiple" => true))) {
$name = basename($file, ".config.php");
$ini[$name] = include($file);
} elseif(check_file_extension($file, "ini")) {
$ini = parse_ini_file($file);
}
if(count($ini) > 0) {
foreach($ini as $k=>$v) {
$config[$k] = $v;
}

View File

@ -316,8 +316,8 @@ if(!function_exists("get_file_extension")) {
}
if(!function_exists("check_file_extension")) {
function check_file_extension($file, $extension, $options=array()) {
return (get_file_extension($file, $options) === $extension);
function check_file_extension($file, $extension) {
return (get_file_extension($file) === $extension);
}
}