summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-05-19 13:08:53 +0200
committerAndrey Andreev <narf@devilix.net>2014-05-19 13:08:53 +0200
commit5b9251f2a2db19d5e77c52def8f97b2cd6443e3e (patch)
tree26f28913003109335a1eb12ace23452aee4cb084 /system
parent096dddec606be325b72d7f02948ebdfa56da5e24 (diff)
parent5a34688f439197e14c0fe73ff2e3c3c2c8636808 (diff)
Merge pull request #3053 from vlakoff/get_config
Simplify code in get_config()
Diffstat (limited to 'system')
-rw-r--r--system/core/Common.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 23b95a497..7f2708151 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;
}
}