summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Guiney <chris@guiney.net>2012-03-10 04:53:24 +0100
committerChristopher Guiney <chris@guiney.net>2012-03-10 04:53:24 +0100
commit9929d6f77a0e54288b1696343439b0e91b21866e (patch)
tree4cf8d6bfd9599361a1d7a83d48aad8d63c4b69ce
parentca6404749a8dd3ee5dd68d64832374dce05fe6a3 (diff)
Allow drivers to be loaded as an array, like models and libraries.
-rw-r--r--system/core/Loader.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 3d91915c4..42d8162bb 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