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

Merged
merged 2 commits into from Mar 10, 2012

2 participants

@chrisguiney

I've committed a simple change that allows one to load multiple drivers as an array, similar to models and libraries.

From a user perspective, it's expected for this to be included functionality.

@philsturgeon philsturgeon commented on an outdated diff Mar 10, 2012
system/core/Loader.php
* @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))

Add a space in here:

if (is_array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@philsturgeon philsturgeon commented on an outdated diff Mar 10, 2012
system/core/Loader.php
* @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 )

And remove two here:

foreach ($library as $driver)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chrisguiney

I've pushed up the requested spacing.

@philsturgeon philsturgeon merged commit cbdec6a into bcit-ci:develop Mar 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment