diff options
author | Kristian Matthews <kristian.matthews@me.com> | 2016-02-11 22:23:30 +0100 |
---|---|---|
committer | Kristian Matthews <kristian.matthews@me.com> | 2016-02-11 22:23:30 +0100 |
commit | 46adb9fdbc9604065dc7990bc61707446aa5cc81 (patch) | |
tree | 3c6ff25dcd757ff21cb8b1a1bacf986968a03244 /system | |
parent | 3c6ace766c449e0a260587896e25d9971de6d812 (diff) |
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 <kristian.matthews@me.com>
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Loader.php | 16 |
1 files changed, 10 insertions, 6 deletions
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 |