summaryrefslogtreecommitdiffstats
path: root/system/libraries/Driver.php
diff options
context:
space:
mode:
authorBarry Mieny <barry@mieny.com>2010-10-04 16:33:58 +0200
committerBarry Mieny <barry@mieny.com>2010-10-04 16:33:58 +0200
commitdd6719738936be31cdaa1758ca86d5eb14dcab3d (patch)
treeb5ef66e31b2d0f4f2c1cbccc367bde92c156e1f9 /system/libraries/Driver.php
parent3351fbc56cea19ec3dd603836beb0a420b1ded65 (diff)
Cleanup of stray spaces and tabs
Diffstat (limited to 'system/libraries/Driver.php')
-rw-r--r--system/libraries/Driver.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 07ef2e724..1261b4c72 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -25,25 +25,25 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link
+ * @link
*/
class CI_Driver_Library {
protected $valid_drivers = array();
protected static $lib_name;
-
+
// The first time a child is used it won't exist, so we instantiate it
// subsequents calls will go straight to the proper child.
function __get($child)
{
if (! isset($this->lib_name))
{
- $this->lib_name = get_class($this);
+ $this->lib_name = get_class($this);
}
// The class will be prefixed with the parent lib
$child_class = $this->lib_name.'_'.$child;
-
+
if (in_array(strtolower($child_class), array_map('strtolower', $this->valid_drivers)))
{
// check and see if the driver is in a separate file
@@ -64,11 +64,11 @@ class CI_Driver_Library {
{
include_once $filepath;
break;
- }
+ }
}
}
}
-
+
// it's a valid driver, but the file simply can't be found
if ( ! class_exists($child_class))
{
@@ -82,14 +82,14 @@ class CI_Driver_Library {
$this->$child = $obj;
return $this->$child;
}
-
+
// The requested driver isn't valid!
log_message('error', "Invalid driver requested: ".$child_class);
show_error("Invalid driver requested: ".$child_class);
}
-
+
// --------------------------------------------------------------------
-
+
}
// END CI_Driver_Library CLASS
@@ -104,11 +104,11 @@ class CI_Driver_Library {
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link
+ * @link
*/
class CI_Driver {
protected $parent;
-
+
private $methods = array();
private $properties = array();
@@ -126,16 +126,16 @@ class CI_Driver {
function decorate($parent)
{
$this->parent = $parent;
-
+
// Lock down attributes to what is defined in the class
// and speed up references in magic methods
-
+
$class_name = get_class($parent);
-
+
if ( ! isset(self::$reflections[$class_name]))
{
$r = new ReflectionObject($parent);
-
+
foreach ($r->getMethods() as $method)
{
if ($method->isPublic())
@@ -151,7 +151,7 @@ class CI_Driver {
$this->properties[] = $prop->getName();
}
}
-
+
self::$reflections[$class_name] = array($this->methods, $this->properties);
}
else
@@ -159,9 +159,9 @@ class CI_Driver {
list($this->methods, $this->properties) = self::$reflections[$class_name];
}
}
-
+
// --------------------------------------------------------------------
-
+
/**
* __call magic method
*
@@ -185,7 +185,7 @@ class CI_Driver {
}
// --------------------------------------------------------------------
-
+
/**
* __get magic method
*
@@ -204,7 +204,7 @@ class CI_Driver {
}
// --------------------------------------------------------------------
-
+
/**
* __set magic method
*
@@ -222,9 +222,9 @@ class CI_Driver {
$this->parent->$var = $val;
}
}
-
+
// --------------------------------------------------------------------
-
+
}
// END CI_Driver CLASS