diff options
author | vlakoff <vlakoff@gmail.com> | 2013-08-19 04:55:34 +0200 |
---|---|---|
committer | vlakoff <vlakoff@gmail.com> | 2013-08-19 04:55:34 +0200 |
commit | 05d043b38896570004fadbed8495fc99c6ef3da6 (patch) | |
tree | d4aff237cccea8eb8432873d2c35f9398f742267 /system | |
parent | 67e5ca678a43a00aecd46cb6d02cfbf9c36d666b (diff) |
Adjustments in static reference handling
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Common.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index 6b3d73100..cf9cd846d 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -228,11 +228,7 @@ if ( ! function_exists('get_config')) { static $_config; - if (isset($_config)) - { - $config =& $_config[0]; - } - else + if (empty($_config)) { $file_path = APPPATH.'config/config.php'; $found = FALSE; @@ -262,16 +258,17 @@ if ( ! function_exists('get_config')) exit(EXIT_CONFIG); } + // references cannot be directly assigned to static variables, so we use an array $_config[0] =& $config; } // Are any values being dynamically added or replaced? foreach ($replace as $key => $val) { - $config[$key] = $val; + $_config[0][$key] = $val; } - return $config; + return $_config[0]; } } @@ -439,7 +436,7 @@ if ( ! function_exists('log_message')) { static $_log; - if ($_log === NULL) + if (empty($_log)) { // references cannot be directly assigned to static variables, so we use an array $_log[0] =& load_class('Log', 'core'); |