diff options
Diffstat (limited to 'system/core/Common.php')
-rw-r--r-- | system/core/Common.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index b5adfacb3..cd6b93355 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -208,15 +208,20 @@ return $_config[0]; } + $file_path = APPPATH.'config/'.ENVIRONMENT.'/config'.EXT; + // Fetch the config file - if ( ! file_exists(APPPATH.'config/config'.EXT)) - { - exit('The configuration file does not exist.'); - } - else + if ( ! file_exists($file_path)) { - require(APPPATH.'config/config'.EXT); + $file_path = APPPATH.'config/config'.EXT; + + if ( ! file_exists($file_path)) + { + exit('The configuration file does not exist.'); + } } + + require($file_path); // Does the $config array exist in the file? if ( ! isset($config) OR ! is_array($config)) |