diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-09 14:52:34 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-09 14:52:34 +0200 |
commit | 2e3e23053d9748c68fa2c0e11f43af67da8743e8 (patch) | |
tree | 27f9c811420cb0d953ec56185667c4b15d7ccc8a /system/libraries/Session/Session.php | |
parent | 683b34d6dfcc10bee7703af605875df9229c2bea (diff) |
Disable Session library under CLI and create a CI singleton to be used by its drivers
Diffstat (limited to 'system/libraries/Session/Session.php')
-rwxr-xr-x | system/libraries/Session/Session.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index e6f6050c0..978506062 100755 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -69,13 +69,21 @@ class CI_Session extends CI_Driver_Library { * routines in its constructor, and manages flashdata aging. * * @param array Configuration parameters + * @return void */ public function __construct(array $params = array()) { + $CI =& get_instance(); + + // No sessions under CLI + if ($CI->input->is_cli_request()) + { + return; + } + log_message('debug', 'CI_Session Class Initialized'); // Get valid drivers list - $CI =& get_instance(); $this->valid_drivers = array( 'Session_native', 'Session_cookie' @@ -587,6 +595,23 @@ class CI_Session extends CI_Driver_Library { */ abstract class CI_Session_driver extends CI_Driver { + protected $CI; + + /** + * Constructor + * + * Gets the CI singleton, so that individual drivers + * don't have to do it separately. + * + * @return void + */ + public function __construct() + { + $this->CI =& get_instance(); + } + + // ------------------------------------------------------------------------ + /** * Decorate * |