diff options
author | vlakoff <vlakoff@gmail.com> | 2014-05-17 07:17:41 +0200 |
---|---|---|
committer | vlakoff <vlakoff@gmail.com> | 2014-05-19 11:48:04 +0200 |
commit | 5a34688f439197e14c0fe73ff2e3c3c2c8636808 (patch) | |
tree | 096606eea9421d35b58e8b141d741be11e752c0f /system/core | |
parent | db6f5f1569951e470f95c8b9154f06c91d7efe8e (diff) |
Simplify code in get_config()
Exact same behavior. The reference was just redundant.
Diffstat (limited to 'system/core')
-rw-r--r-- | system/core/Common.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index 677ceaf97..e340931b7 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -226,9 +226,9 @@ if ( ! function_exists('get_config')) */ function &get_config(Array $replace = array()) { - static $_config; + static $config; - if (empty($_config)) + if (empty($config)) { $file_path = APPPATH.'config/config.php'; $found = FALSE; @@ -257,18 +257,15 @@ if ( ! function_exists('get_config')) echo 'Your config file does not appear to be formatted correctly.'; exit(3); // 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[0][$key] = $val; + $config[$key] = $val; } - return $_config[0]; + return $config; } } |