summaryrefslogtreecommitdiffstats
path: root/system/libraries/Driver.php
diff options
context:
space:
mode:
authorJonatas Miguel <jonatas.df.miguel@gmail.com>2012-10-24 19:30:36 +0200
committerJonatas Miguel <jonatas.df.miguel@gmail.com>2012-10-24 19:30:36 +0200
commitb51823dde5fbae508b8ebf99258d2f514a8bece8 (patch)
tree4db09a22f85e0ddf151c940cd3e6fbaa799b8513 /system/libraries/Driver.php
parenta53f402b78ad07fb0f6da19cff0c7bec3a09a4c0 (diff)
parenta7001e968a4791312391eb245ad84888893cda8f (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Conflicts: user_guide_src/source/changelog.rst
Diffstat (limited to 'system/libraries/Driver.php')
-rw-r--r--system/libraries/Driver.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index d67ee2549..5d642b982 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -54,14 +54,30 @@ class CI_Driver_Library {
protected $lib_name;
/**
+ * 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 mixed $child
- * @return mixed
+ * @param string Child class name
+ * @return object Child class
*/
public function __get($child)
{
+ // Try to load the driver
+ return $this->load_driver($child);
+ }
+
+ /**
+ * Load driver
+ *
+ * Separate load_driver call to support explicit driver load by library or user
+ *
+ * @param string Child class name
+ * @return object Child class
+ */
+ public function load_driver($child)
+ {
if ( ! isset($this->lib_name))
{
$this->lib_name = get_class($this);
@@ -156,7 +172,8 @@ class CI_Driver {
/**
* Array of methods and properties for the parent class(es)
*
- * @var array
+ * @static
+ * @var array
*/
protected static $_reflections = array();