Update config.php

This commit is contained in:
Namhyeon Go 2018-03-14 13:34:08 +09:00 committed by GitHub
parent 88fe3a3c7b
commit c48bdcbf46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,10 +26,25 @@ if(!function_exists("read_config")) {
} }
} }
function get_config() { if(!function_exists("get_config")) {
global $config; function get_config() {
$config = is_array($config) ? $config : read_config(); global $config;
return $config; $config = is_array($config) ? $config : read_config();
return $config;
}
}
if(!function_exists("get_config_value")) {
function get_config_value($key) {
$config = get_config();
$config_value = '';
if(!array_key_empty($key, $config)) {
$config_value = $config[$key];
}
return $config_value;
}
} }
$config = read_config(); $config = read_config();