summaryrefslogtreecommitdiffstats
path: root/system/libraries/Driver.php
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-08-29 16:09:29 +0200
committerdchill42 <dchill42@gmail.com>2012-08-29 16:09:29 +0200
commit9a949fab0c8428233f0de5b199bf955e61fb0e0a (patch)
tree2ec239870adaa5ce0394bf311122a2052d977ce7 /system/libraries/Driver.php
parent6030719346e9b0eb0e0ea99c679cadeb1fe4afde (diff)
parent1e40c213610a4bb643e51c2b298629471664163b (diff)
Merge branch 'develop' of github.com:/EllisLab/CodeIgniter into load_config_units
Diffstat (limited to 'system/libraries/Driver.php')
-rw-r--r--system/libraries/Driver.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index d67ee2549..1d084c8e4 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -54,13 +54,29 @@ 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))
{
@@ -268,4 +284,4 @@ class CI_Driver {
}
/* End of file Driver.php */
-/* Location: ./system/libraries/Driver.php */ \ No newline at end of file
+/* Location: ./system/libraries/Driver.php */