Skip to content

Commit

Permalink
Restored errantly removed ucfirst
Browse files Browse the repository at this point in the history
  • Loading branch information
dchill42 committed Aug 31, 2011
1 parent 5073a37 commit 4d1cd4c
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions system/libraries/Driver.php
Expand Up @@ -32,29 +32,29 @@ class CI_Driver_Library {
protected $valid_drivers = array();
protected $lib_name;

/**
* Get magic method
*
/**
* Get magic method
*
* The first time a child is used it won't exist, so we instantiate it
* subsequents calls will go straight to the proper child.
*
* @param string Child class name
* @return object Child class
*/
*
* @param string Child class name
* @return object Child class
*/
public function __get($child)
{
// Try to load the driver
// Try to load the driver
return load_driver($child);
}
}

/**
* Load driver
*
/**
* Load driver
*
* Separate load_driver call to support explicit driver load by library or user
*
* @param string Child class name
* @return object Child class
*/
*
* @param string Child class name
* @return object Child class
*/
public function load_driver($child)
{
if ( ! isset($this->lib_name))
Expand All @@ -66,8 +66,8 @@ public function load_driver($child)
$child_class = $this->lib_name.'_'.$child;

// Remove the CI_ prefix and lowercase
$lib_name = strtolower(preg_replace('/^CI_/', '', $this->lib_name));
$driver_name = strtolower(preg_replace('/^CI_/', '', $child_class));
$lib_name = ucfirst(strtolower(str_replace('CI_', '', $this->lib_name)));
$driver_name = strtolower(str_replace('CI_', '', $child_class));

if (in_array($driver_name, array_map('strtolower', $this->valid_drivers)))
{
Expand Down

0 comments on commit 4d1cd4c

Please sign in to comment.