summaryrefslogtreecommitdiffstats
path: root/system/libraries/Driver.php
diff options
context:
space:
mode:
authorEric Roberts <eric@cryode.com>2012-04-15 00:49:21 +0200
committerEric Roberts <eric@cryode.com>2012-04-15 00:49:21 +0200
commit8cefb3ff51de4f023753c0146eb16950f48601a9 (patch)
treeed868ec7a795fcf1fe97efc5642d26dc1d1faefe /system/libraries/Driver.php
parent0760a48d431fb9ab85f2a0ca9af63aa131e29520 (diff)
parent0f2211711deceb74157d6811116acc0376d3157d (diff)
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into feature/form_error_msgs
Conflicts: system/language/english/form_validation_lang.php
Diffstat (limited to 'system/libraries/Driver.php')
-rw-r--r--system/libraries/Driver.php54
1 files changed, 22 insertions, 32 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 4e8944311..f409f47d4 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -2,7 +2,7 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 5.1.6 or newer
+ * An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
*
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Driver Library Class
*
@@ -84,8 +82,8 @@ class CI_Driver_Library {
// it's a valid driver, but the file simply can't be found
if ( ! class_exists($child_class))
{
- log_message('error', "Unable to load the requested driver: ".$child_class);
- show_error("Unable to load the requested driver: ".$child_class);
+ log_message('error', 'Unable to load the requested driver: '.$child_class);
+ show_error('Unable to load the requested driver: '.$child_class);
}
}
@@ -96,15 +94,11 @@ class CI_Driver_Library {
}
// The requested driver isn't valid!
- log_message('error', "Invalid driver requested: ".$child_class);
- show_error("Invalid driver requested: ".$child_class);
+ log_message('error', 'Invalid driver requested: '.$child_class);
+ show_error('Invalid driver requested: '.$child_class);
}
- // --------------------------------------------------------------------
-
}
-// END CI_Driver_Library CLASS
-
/**
* CodeIgniter Driver Class
@@ -120,12 +114,12 @@ class CI_Driver_Library {
*/
class CI_Driver {
- protected $parent;
+ protected $_parent;
- private $methods = array();
- private $properties = array();
+ protected $_methods = array();
+ protected $_properties = array();
- private static $reflections = array();
+ protected static $_reflections = array();
/**
* Decorate
@@ -137,14 +131,14 @@ class CI_Driver {
*/
public function decorate($parent)
{
- $this->parent = $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]))
+ if ( ! isset(self::$_reflections[$class_name]))
{
$r = new ReflectionObject($parent);
@@ -152,7 +146,7 @@ class CI_Driver {
{
if ($method->isPublic())
{
- $this->methods[] = $method->getName();
+ $this->_methods[] = $method->getName();
}
}
@@ -160,15 +154,15 @@ class CI_Driver {
{
if ($prop->isPublic())
{
- $this->properties[] = $prop->getName();
+ $this->_properties[] = $prop->getName();
}
}
- self::$reflections[$class_name] = array($this->methods, $this->properties);
+ self::$_reflections[$class_name] = array($this->_methods, $this->_properties);
}
else
{
- list($this->methods, $this->properties) = self::$reflections[$class_name];
+ list($this->_methods, $this->_properties) = self::$_reflections[$class_name];
}
}
@@ -179,16 +173,15 @@ class CI_Driver {
*
* Handles access to the parent driver library's methods
*
- * @access public
* @param string
* @param array
* @return mixed
*/
public function __call($method, $args = array())
{
- if (in_array($method, $this->methods))
+ if (in_array($method, $this->_methods))
{
- return call_user_func_array(array($this->parent, $method), $args);
+ return call_user_func_array(array($this->_parent, $method), $args);
}
$trace = debug_backtrace();
@@ -208,9 +201,9 @@ class CI_Driver {
*/
public function __get($var)
{
- if (in_array($var, $this->properties))
+ if (in_array($var, $this->_properties))
{
- return $this->parent->$var;
+ return $this->_parent->$var;
}
}
@@ -227,16 +220,13 @@ class CI_Driver {
*/
public function __set($var, $val)
{
- if (in_array($var, $this->properties))
+ if (in_array($var, $this->_properties))
{
- $this->parent->$var = $val;
+ $this->_parent->$var = $val;
}
}
- // --------------------------------------------------------------------
-
}
-// END CI_Driver CLASS
/* End of file Driver.php */
-/* Location: ./system/libraries/Driver.php */
+/* Location: ./system/libraries/Driver.php */ \ No newline at end of file