diff options
author | Bruno Barão <brunobarao@gmail.com> | 2012-10-08 17:21:36 +0200 |
---|---|---|
committer | Bruno Barão <brunobarao@gmail.com> | 2012-10-08 17:21:36 +0200 |
commit | 02561acf13f19881f4e3f95cf2fb423665d5ce8b (patch) | |
tree | fb88af9da77e37447d9e1513146aad870e65ea5d /system/libraries/Driver.php | |
parent | b453e16668c70b0eb02b5ae69cd3196d735421f8 (diff) | |
parent | 960e616d18c77f463e7c53f666d98b09f5ca9057 (diff) |
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'system/libraries/Driver.php')
-rw-r--r-- | system/libraries/Driver.php | 22 |
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 */ |