From 96b72ae4dc1334431f95d3f3151409f656a19725 Mon Sep 17 00:00:00 2001 From: joelcox Date: Sun, 16 Jan 2011 14:16:18 +0100 Subject: Fixed bug that prevented global config from loading on error --- system/core/Config.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'system') 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; -- cgit v1.2.3-24-g4f1b