summaryrefslogtreecommitdiffstats
path: root/system/libraries/Driver.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-08-29 15:53:57 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-08-29 15:53:57 +0200
commit1e40c213610a4bb643e51c2b298629471664163b (patch)
tree79a3e038ab0a8e3ec7a3c878eb05eb9cd9c44fa1 /system/libraries/Driver.php
parent2d5c209943ef1e2644504e8d5cb32d3d66b45632 (diff)
parent88b636b06dd91807706e2d442d910fe8b6a3b50c (diff)
Merge pull request #353 from dchill42/session
Switched Sessions to use Drivers Adding native PHP sessions and keeping original-flavor CI cookie sessions
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 */