reasonableframework/system/config.php

37 lines
800 B
PHP
Raw Normal View History

2017-12-17 20:40:04 +00:00
<?php
2018-03-07 04:44:06 +00:00
/**
* @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;
2018-02-12 05:43:11 +00:00
if($handle = opendir('./config')) {
while (false !== ($file = readdir($handle))) {
2018-03-07 04:44:06 +00:00
if ($file != "." && $file != ".." && @end(explode('.', $file)) == 'ini') {
2018-02-12 05:43:11 +00:00
$ini = parse_ini_file('./config/' . $file);
foreach($ini as $k=>$v) {
$config[$k] = $v;
}
}
}
closedir($handle);
2017-12-17 20:40:04 +00:00
}
}
}
2018-02-12 05:43:11 +00:00
2018-03-07 04:44:06 +00:00
function get_config() {
global $config;
return $config;
}
$config = array();
set_config();
2018-02-12 05:43:11 +00:00
$config = get_config();