Update config.php
This commit is contained in:
parent
e6bb3fbd3e
commit
9fb69db202
|
|
@ -1,10 +1,18 @@
|
|||
<?php
|
||||
if(!function_exists("get_config")) {
|
||||
function get_config() {
|
||||
$config = array();
|
||||
/**
|
||||
* @file security.php
|
||||
* @date 2018-01-18
|
||||
* @author Go Namhyeon <gnh1201@gmail.com>
|
||||
* @brief Configuration module for VSPF
|
||||
*/
|
||||
|
||||
if(!function_exists("set_config")) {
|
||||
function set_config() {
|
||||
global $config;
|
||||
|
||||
if($handle = opendir('./config')) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != ".." && end(explode('.', $file)) == 'ini') {
|
||||
if ($file != "." && $file != ".." && @end(explode('.', $file)) == 'ini') {
|
||||
$ini = parse_ini_file('./config/' . $file);
|
||||
foreach($ini as $k=>$v) {
|
||||
$config[$k] = $v;
|
||||
|
|
@ -13,9 +21,16 @@ if(!function_exists("get_config")) {
|
|||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
|
||||
function get_config() {
|
||||
global $config;
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
$config = array();
|
||||
set_config();
|
||||
|
||||
$config = get_config();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user