Skip to content
Browse files

Adapted main and autoload config bootstrapping to also comply with #1356



Signed-off-by: dchill42 <dchill42@gmail.com>
  • Loading branch information...
1 parent 95da1cf commit 1eeebdb25db31941690c8b8082902c95687dc094 @dchill42 committed Sep 30, 2012
Showing with 8 additions and 7 deletions.
  1. +8 −7 system/core/CodeIgniter.php
View
15 system/core/CodeIgniter.php
@@ -221,21 +221,22 @@ public static function &instance($basepath = NULL, $apppath = NULL, $env = NULL)
$path = $apppath.'config/';
foreach (array('config', 'autoload') as $name)
{
- if ($env && file_exists($path.$env.'/'.$name.'.php'))
+ // Get regular config
+ if (file_exists($path.$name.'.php'))
{
- // Use ENVIRONMENT config
- include($path.$env.'/'.$name.'.php');
- }
- else if (file_exists($path.$name.'.php'))
- {
- // Use regular config
include($path.$name.'.php');
}
else if ($name == 'config')
{
// Can't run without main config - error out
static::_status_exit(503, 'The configuration file does not exist.');
}
+
+ // Check for ENVIRONMENT config override
+ if ($env && file_exists($path.$env.'/'.$name.'.php'))
+ {
+ include($path.$env.'/'.$name.'.php');
+ }
}
// Does the $config array exist?

0 comments on commit 1eeebdb

Please sign in to comment.
Something went wrong with that request. Please try again.