From 68e3b468cf83048e9da80ca20fda01df4d561738 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 6 Aug 2011 20:42:53 -0500 Subject: [PATCH] refactoring config class. --- system/config.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/system/config.php b/system/config.php index b2bccd07..3f27c910 100644 --- a/system/config.php +++ b/system/config.php @@ -64,7 +64,7 @@ public static function set($key, $value) if (is_null($key) or ! static::load($module, $file)) { - throw new \Exception("Unable to find configuration file item [$key]."); + throw new \Exception("Error setting configuration option. Option [$key] is not defined."); } static::$items[$module][$file][$key] = $value; @@ -85,8 +85,6 @@ private static function parse($key) // the configuration key, otherwise, we will use "application" as the module. $module = (strpos($key, '::') !== false) ? substr($key, 0, strpos($key, ':')) : 'application'; - // If the configuration item is stored in a module, we need to strip the module qualifier - // off of the configuration key before continuing. if ($module != 'application') { $key = substr($key, strpos($key, ':') + 2); @@ -94,8 +92,6 @@ private static function parse($key) $segments = explode('.', $key); - // If there is more than one segment, we need to splice together and portion of the - // configuration key that comes after the first segment, which is the file name. $key = (count($segments) > 1) ? implode('.', array_slice($segments, 1)) : null; return array($module, $segments[0], $key); @@ -113,8 +109,6 @@ private static function parse($key) */ public static function load($module, $file) { - // If the configuration items for this module and file have already been - // loaded, we can bail out of this method. if (isset(static::$items[$module]) and array_key_exists($file, static::$items[$module])) return true; $path = ($module === 'application') ? CONFIG_PATH : MODULE_PATH.$module.'/config/';