Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow drivers to be loaded as an array, like models and libraries. #1155

Merged
merged 2 commits into from Mar 10, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion system/core/Loader.php
Expand Up @@ -615,13 +615,22 @@ public function config($file = '', $use_sections = FALSE, $fail_gracefully = FAL
*
* 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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space in here:

if (is_array

{
foreach ( $library as $driver )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And remove two here:

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
Expand Down