summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoelcox <joel@mickly.com>2011-01-16 14:16:18 +0100
committerjoelcox <joel@mickly.com>2011-01-16 14:16:18 +0100
commit96b72ae4dc1334431f95d3f3151409f656a19725 (patch)
treef6563d28f208b7050896db349eecc254ab19e528
parent4bbc4ff0b58546263ed603bcec5fb881f021927a (diff)
Fixed bug that prevented global config from loading on error
-rw-r--r--system/core/Config.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 56e3bccd8..ae914414d 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -94,14 +94,17 @@ class CI_Config {
continue;
}
- if ( ! $file_path)
+ if ( ! file_exists($file_path))
{
- if ( ! file_exists($path.'config/'.$file.EXT))
+ log_message('debug', 'Config for '.ENVIRONMENT.' environment is not found. Trying global config.');
+ $file_path = $path.'config/'.$file.EXT;
+
+ if ( ! file_exists($file_path))
{
- $file_path = $path.'config/'.$file.EXT;
+ continue;
}
}
-
+
include($file_path);
if ( ! isset($config) OR ! is_array($config))
@@ -142,7 +145,7 @@ class CI_Config {
{
return FALSE;
}
- show_error('The configuration file '.$environment.'/'.$file.EXT.' does not exist.');
+ show_error('The configuration file '.ENVIRONMENT.'/'.$file.EXT.' and '.$file.EXT.' do not exist.');
}
return TRUE;