summaryrefslogtreecommitdiffstats
path: root/system/core/Loader.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@server-speed.net>2011-04-10 10:39:31 +0200
committerFlorian Pritz <bluewind@server-speed.net>2011-04-10 10:39:31 +0200
commit1bdc9c8903eb2db33fdb8174d61e15100dfbbca8 (patch)
treeb0c645ad99e04f34817fc4e6385792111db42274 /system/core/Loader.php
parent413d0cdac49257089a0790f6ac92973a36a6b69f (diff)
update to CI 2.0.2
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Diffstat (limited to 'system/core/Loader.php')
-rwxr-xr-xsystem/core/Loader.php45
1 files changed, 27 insertions, 18 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 07166188e..e75805d0e 100755
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -79,9 +79,9 @@ class CI_Loader {
{
if (is_array($library))
{
- foreach($library as $read)
+ foreach ($library as $class)
{
- $this->library($read);
+ $this->library($class, $params);
}
return;
@@ -97,17 +97,7 @@ class CI_Loader {
$params = NULL;
}
- if (is_array($library))
- {
- foreach ($library as $class)
- {
- $this->_ci_load_class($class, $params, $object_name);
- }
- }
- else
- {
- $this->_ci_load_class($library, $params, $object_name);
- }
+ $this->_ci_load_class($library, $params, $object_name);
}
// --------------------------------------------------------------------
@@ -127,7 +117,7 @@ class CI_Loader {
{
if (is_array($model))
{
- foreach($model as $babe)
+ foreach ($model as $babe)
{
$this->model($babe);
}
@@ -880,8 +870,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 (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT))
+ {
+ include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT);
+ break;
+ }
+ elseif (defined('ENVIRONMENT') AND 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;
@@ -964,7 +965,15 @@ class CI_Loader {
*/
function _ci_autoloader()
{
- include_once(APPPATH.'config/autoload'.EXT);
+ if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT))
+ {
+ include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT);
+ }
+ else
+ {
+ include_once(APPPATH.'config/autoload'.EXT);
+ }
+
if ( ! isset($autoload))
{
@@ -1092,4 +1101,4 @@ class CI_Loader {
}
/* End of file Loader.php */
-/* Location: ./system/core/Loader.php */ \ No newline at end of file
+/* Location: ./system/core/Loader.php */