Update config.php
This commit is contained in:
parent
7617c6de66
commit
33eac24bfa
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user