diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-12 10:56:34 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-12 10:56:34 +0200 |
commit | bffe3fb935c8a28e1ccacf56f678a491edcff043 (patch) | |
tree | 5a39ba6907623d5ad46b7d13ef17e360df1dfe5e /system/libraries/Driver.php | |
parent | 55b82c95be57a6727d45d6ae9652ff612f96bc37 (diff) | |
parent | 9ae82faaad2f6b07a050d79129652b74483d1da0 (diff) |
Merge changes from develop
Diffstat (limited to 'system/libraries/Driver.php')
-rw-r--r-- | system/libraries/Driver.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index d67ee2549..769d892dc 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); |