summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoelcox <joel@mickly.com>2011-01-16 18:49:39 +0100
committerjoelcox <joel@mickly.com>2011-01-16 18:49:39 +0100
commit1bfd9fabffc47ae7f6efc4704ae3125599004de8 (patch)
tree495c5f881ed84f34653bd303e13af9fc08b69589
parent42aa95bfee77baa6d4fe2728c4a02c61b7a3cac1 (diff)
Set error_reporting to E_ALL when environment unknown and changed CI_Loader to load environment configs first.
-rw-r--r--index.php1
-rw-r--r--system/core/Loader.php15
2 files changed, 14 insertions, 2 deletions
diff --git a/index.php b/index.php
index 016ffc015..7741d5cb8 100644
--- a/index.php
+++ b/index.php
@@ -112,6 +112,7 @@
}
else
{
+ error_reporting(E_ALL);
exit("The application environment is not set correctly.");
}
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 225b43912..640a6302b 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -880,8 +880,19 @@ class CI_Loader {
foreach ($config_component->_config_paths as $path)
{
// We test for both uppercase and lowercase, for servers that
- // are case-sensitive with regard to file names
- if (file_exists($path .'config/'.strtolower($class).EXT))
+ // are case-sensitive with regard to file names. Check for environment
+ // first, global next
+ if (file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT))
+ {
+ include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT);
+ break;
+ }
+ elseif (file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT))
+ {
+ include_once($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT);
+ break;
+ }
+ elseif (file_exists($path .'config/'.strtolower($class).EXT))
{
include_once($path .'config/'.strtolower($class).EXT);
break;