Merge pull request #4453 from EpicKris/feature/Autoload-Driver-Object-Name
Autoload Driver Object Names
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 37d1eca..80de804 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -718,9 +718,16 @@
{
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;
@@ -1334,10 +1341,7 @@
// Autoload drivers
if (isset($autoload['drivers']))
{
- foreach ($autoload['drivers'] as $item)
- {
- $this->driver($item);
- }
+ $this->driver($autoload['drivers']);
}
// Load libraries