From 5a34688f439197e14c0fe73ff2e3c3c2c8636808 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sat, 17 May 2014 07:17:41 +0200 Subject: Simplify code in get_config() Exact same behavior. The reference was just redundant. --- system/core/Common.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'system') 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; } } -- cgit v1.2.3-24-g4f1b