summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/Session.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-09 14:52:34 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-09 14:52:34 +0200
commit2e3e23053d9748c68fa2c0e11f43af67da8743e8 (patch)
tree27f9c811420cb0d953ec56185667c4b15d7ccc8a /system/libraries/Session/Session.php
parent683b34d6dfcc10bee7703af605875df9229c2bea (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-xsystem/libraries/Session/Session.php27
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
*