summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorDarren Hill <dchill42@gmail.com>2011-08-31 19:59:09 +0200
committerDarren Hill <dchill42@gmail.com>2011-08-31 19:59:09 +0200
commit4d1cd4c56697bc53b5a9899089ab4c978c66e1da (patch)
tree4a802af9abfa4a109db118ddc5cdd156f23a1e92 /system/libraries
parent5073a375951f09b654f6b991df7ca04e1f88d93c (diff)
Restored errantly removed ucfirst
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Driver.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 80c0e2812..e958fc67f 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -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))
@@ -66,8 +66,8 @@ class CI_Driver_Library {
$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)))
{