Update config.php

This commit is contained in:
Namhyeon Go 2018-05-26 01:28:17 +09:00 committed by GitHub
parent 777fb92a46
commit bac0c413b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,23 +7,21 @@
*/ */
if(!function_exists("read_config")) { if(!function_exists("read_config")) {
function read_config() { function read_config() {
$config = array(); $config = array();
if($handle = opendir('./config')) { $files = get_storage_files("config");
while (false !== ($file = readdir($handle))) { foreach($files as $file) {
if ($file != "." && $file != ".." && @end(explode('.', $file)) == 'ini') { if(check_file_extension($file, "ini")) {
$ini = parse_ini_file('./config/' . $file); $ini = parse_ini_file($file);
foreach($ini as $k=>$v) { foreach($ini as $k=>$v) {
$config[$k] = $v; $config[$k] = $v;
} }
}
} }
}
closedir($handle);
}
return $config; return $config;
} }
} }
if(!function_exists("get_config")) { if(!function_exists("get_config")) {