diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-03-10 17:41:20 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-03-10 17:41:20 +0100 |
commit | cbdec6a863eaebf4e3edf5bffc49853cc54c8e0a (patch) | |
tree | 75669e389b9714d3fd9e19e92053da4d0c52bcb6 /system/core | |
parent | c6dfcca21f5f5cb7b2572776c251683d53c669c1 (diff) | |
parent | b54d355faabef775703119a23dd55004b84a1140 (diff) |
Merge pull request #1155 from chrisguiney/develop
Allow drivers to be loaded as an array, like models and libraries.
Diffstat (limited to 'system/core')
-rw-r--r-- | system/core/Loader.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php index 3d91915c4..9b9cc2fef 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -615,13 +615,22 @@ class CI_Loader { * * Loads a driver library * - * @param string the name of the class + * @param mixed the name of the class or array of classes * @param mixed the optional parameters * @param string an optional object name * @return void */ public function driver($library = '', $params = NULL, $object_name = NULL) { + if (is_array($library)) + { + foreach ($library as $driver) + { + $this->driver($driver); + } + return FALSE; + } + if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself |