From 46adb9fdbc9604065dc7990bc61707446aa5cc81 Mon Sep 17 00:00:00 2001 From: Kristian Matthews Date: Thu, 11 Feb 2016 21:23:30 +0000 Subject: Autoload Driver Object Names Updated documentation for `$autoload['drivers']`. Updated loader to autoload drivers with object names the same as autoloading libraries. Signed-off-by: Kristian Matthews --- system/core/Loader.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 18e4c5287..dc61ed882 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -688,9 +688,16 @@ class CI_Loader { { if (is_array($library)) { - foreach ($library as $driver) + foreach ($library as $key => $value) { - $this->driver($driver); + if (is_int($key)) + { + $this->driver($value, $params); + } + else + { + $this->driver($key, $params, $value) + } } return $this; @@ -1304,10 +1311,7 @@ class CI_Loader { // Autoload drivers if (isset($autoload['drivers'])) { - foreach ($autoload['drivers'] as $item) - { - $this->driver($item); - } + $this->driver($autoload['drivers']); } // Load libraries -- cgit v1.2.3-24-g4f1b From 0d181ee540749c3a5dc147b1e280b7515d1b360e Mon Sep 17 00:00:00 2001 From: Kristian Matthews Date: Fri, 12 Feb 2016 12:13:04 +0000 Subject: Fixed syntax error. Signed-off-by: Kristian Matthews --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index dc61ed882..b9f5a52c7 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -696,7 +696,7 @@ class CI_Loader { } else { - $this->driver($key, $params, $value) + $this->driver($key, $params, $value); } } -- cgit v1.2.3-24-g4f1b