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