Update config.php

This commit is contained in:
Namhyeon Go 2018-02-12 14:43:11 +09:00 committed by GitHub
parent b7b45ebe84
commit e266e4a6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,21 @@
<?php
$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;
}
if(!function_exists("get_config")) {
function get_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;
}
}
}
closedir($handle);
}
return $config;
}
closedir($handle);
}
$config = get_config();