summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanasis Polychronakis <thanpolas@gmail.com>2012-05-14 20:31:04 +0200
committerThanasis Polychronakis <thanpolas@gmail.com>2012-05-31 20:39:56 +0200
commitb6e0b588522055ddffc44e63e5479309fa3b4b14 (patch)
tree938e493873dba98c2dbb15194c66e42ef02be7fe
parent5e63ad76863209c21b5a794cb4d478f59f57e386 (diff)
Load base config first, then environment's config
-rw-r--r--system/core/Common.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 4b733ac97..f468747c6 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -231,21 +231,21 @@ if ( ! function_exists('get_config'))
return $_config[0];
}
- // Is the config file in the environment folder?
- if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
- {
- $file_path = APPPATH.'config/config.php';
+ $file_path = APPPATH.'config/config.php';
+ $found = false;
+ if (file_exists($file_path)) {
+ $found = true;
+ require($file_path);
}
- // Fetch the config file
- if ( ! file_exists($file_path))
+ // Is the config file in the environment folder?
+ if (defined(ENVIRONMENT) && file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
{
- set_status_header(503);
+ require($file_path);
+ } else if (!$found) {
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))
{