Commits

Joël Cox committed 7d603b2

Set error_reporting to E_ALL when environment unknown and changed CI_Loader to load environment configs first.

  • Participants
  • Parent commits 2a8a00b

Comments (0)

Files changed (2)

 	}
 	else
 	{
+		error_reporting(E_ALL);
 		exit("The application environment is not set correctly.");		
 	}
 	

File system/core/Loader.php

 				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;