summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorThanasis Polychronakis <thanpolas@gmail.com>2012-05-14 20:31:04 +0200
committerThanasis Polychronakis <thanpolas@gmail.com>2012-05-14 20:31:04 +0200
commit66c982e8fa8fb0261394b63b25a3817503263d17 (patch)
tree602a5222eb39ce4a5bd7f95e479eff3646db7e41 /system/core
parentfff6c2a3caa1ce14e58fcb3ee0d937d17985eea1 (diff)
Load base config first, then environment's config
Diffstat (limited to 'system/core')
-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 78aa6e874..01b0d8673 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))
{