summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-01 10:51:27 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-01 10:51:27 +0200
commitf3b95d383806a9366de9a526a37d78287a09d8b6 (patch)
tree7d53e8612dca6e41c330829062a03e3d8520a1f7 /system/core/Common.php
parent5e63ad76863209c21b5a794cb4d478f59f57e386 (diff)
parent2b8f25ebb352cb370a0f39c9a3efb3a2d8df2c06 (diff)
Merge pull request #1356 from thanpolas/new-config-load-sequence
New config load sequence
Diffstat (limited to 'system/core/Common.php')
-rw-r--r--system/core/Common.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 4b733ac97..159cc0d2b 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -231,21 +231,25 @@ 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';
+ $found = FALSE;
+ if (file_exists($file_path))
{
- $file_path = APPPATH.'config/config.php';
+ $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'))
+ {
+ require($file_path);
+ }
+ elseif ( ! $found)
{
set_status_header(503);
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))
{