diff options
author | Andrey Andreev <narf@devilix.net> | 2014-12-17 18:01:31 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-12-17 18:01:31 +0100 |
commit | 95c31adc770164f27c8dd678f30c60494827af02 (patch) | |
tree | 0051e69c11b076486c4854f5b6c97ce42a028c4d | |
parent | 7928f617486d09f4d5a6285f776b300537184619 (diff) |
Extend fix for #3419
-rw-r--r-- | system/core/Loader.php | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php index e0a7d5e1b..afdedf522 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1090,31 +1090,38 @@ class CI_Loader { if (is_array($config_component->_config_paths)) { - // Break on the first found file, thus package files - // are not overridden by default paths + $found = FALSE; 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. Check for environment - // first, global next + // are case-sensitive with regard to file names. Load global first, + // override with environment next + if (file_exists($path.'config/'.strtolower($class).'.php')) + { + include($path.'config/'.strtolower($class).'.php'); + $found = TRUE; + } + elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) + { + include($path.'config/'.ucfirst(strtolower($class)).'.php'); + $found = TRUE; + } + if (file_exists($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) { include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); - break; + $found = TRUE; } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) { include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); - break; + $found = TRUE; } - elseif (file_exists($path.'config/'.strtolower($class).'.php')) - { - include($path.'config/'.strtolower($class).'.php'); - break; - } - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) + + // Break on the first found configuration, thus package + // files are not overridden by default paths + if ($found === TRUE) { - include($path.'config/'.ucfirst(strtolower($class)).'.php'); break; } } @@ -1193,14 +1200,11 @@ class CI_Loader { */ protected function _ci_autoloader() { + include(APPPATH.'config/autoload.php'); if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); } - else - { - include(APPPATH.'config/autoload.php'); - } if ( ! isset($autoload)) { |