Update config.php

This commit is contained in:
Namhyeon Go 2018-03-09 21:31:50 +09:00 committed by GitHub
parent 7617c6de66
commit 33eac24bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,8 @@
* @brief Configuration module for VSPF * @brief Configuration module for VSPF
*/ */
if(!function_exists("set_config")) { if(!function_exists("read_config")) {
function set_config() { function read_config() {
if($handle = opendir('./config')) { if($handle = opendir('./config')) {
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && @end(explode('.', $file)) == 'ini') { if ($file != "." && $file != ".." && @end(explode('.', $file)) == 'ini') {
@ -24,9 +24,8 @@ if(!function_exists("set_config")) {
function get_config() { function get_config() {
global $config; global $config;
$config = is_array($config) ? $config : read_config();
$config = is_array($config) ? $config : array();
return $config; return $config;
} }
$config = set_config(); $config = read_config();