From 7d741c2ba0cc694b57469c692bb0b197e0127e95 Mon Sep 17 00:00:00 2001 From: Michael Long Date: Mon, 12 Aug 2019 11:58:40 +0800 Subject: Adapt to new version of php-redis --- .../Session/drivers/Session_redis_driver.php | 45 +++++++++++++++++++--- 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 9ff6a0e1f..4976e9473 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -240,7 +240,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $this->_session_id = $session_id; } - $this->_redis->setTimeout($this->_lock_key, 300); + $this->_expire($this->_lock_key, 300); if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE) { if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration'])) @@ -253,7 +253,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return $this->_fail(); } - return ($this->_redis->setTimeout($this->_key_prefix.$session_id, $this->_config['expiration'])) + return ($this->_expire($this->_key_prefix.$session_id, $this->_config['expiration'])) ? $this->_success : $this->_fail(); } @@ -272,7 +272,8 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle if (isset($this->_redis)) { try { - if ($this->_redis->ping() === '+PONG') + $ping = $this->_redis->ping(); + if ($ping === '+PONG' || $ping === TRUE) { $this->_release_lock(); if ($this->_redis->close() === FALSE) @@ -307,9 +308,9 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { if (isset($this->_redis, $this->_lock_key)) { - if (($result = $this->_redis->delete($this->_key_prefix.$session_id)) !== 1) + if (($result = $this->_delete($this->_key_prefix.$session_id)) !== 1) { - log_message('debug', 'Session: Redis::delete() expected to return 1, got '.var_export($result, TRUE).' instead.'); + log_message('debug', 'Session: Redis::del() expected to return 1, got '.var_export($result, TRUE).' instead.'); } $this->_cookie_destroy(); @@ -368,7 +369,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // correct session ID. if ($this->_lock_key === $this->_key_prefix.$session_id.':lock') { - return $this->_redis->setTimeout($this->_lock_key, 300); + return $this->_expire($this->_lock_key, 300); } // 30 attempts to obtain a lock, in case another request already has it @@ -439,4 +440,36 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return TRUE; } + // ------------------------------------------------------------------------ + + /** + * Expire + * + * Sets expiration for a key + * + * @return bool + */ + protected function _expire($key, $timeout) + { + if (method_exists($this->_redis, 'expire')) + return $this->_redis->expire($key, $timeout); + return $this->_redis->setTimeout($key, $timeout); + } + + // ------------------------------------------------------------------------ + + /** + * Delete + * + * Deletes a key + * + * @return bool + */ + protected function _delete($key) + { + if (method_exists($this->_redis, 'del')) + return $this->_redis->del($key); + return $this->_redis->delete($key); + } + } -- cgit v1.2.3-24-g4f1b From 4aec0ed32942b52535b69bfbe33ff9e8e957b245 Mon Sep 17 00:00:00 2001 From: Michael Long Date: Mon, 12 Aug 2019 12:25:22 +0800 Subject: Add parameter description --- system/libraries/Session/drivers/Session_redis_driver.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 4976e9473..1f1004fb9 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -447,13 +447,15 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle * * Sets expiration for a key * + * @param string $key Redis key + * @param int $ttl The key's remaining Time To Live, in seconds. * @return bool */ - protected function _expire($key, $timeout) + protected function _expire($key, $ttl) { if (method_exists($this->_redis, 'expire')) - return $this->_redis->expire($key, $timeout); - return $this->_redis->setTimeout($key, $timeout); + return $this->_redis->expire($key, $ttl); + return $this->_redis->setTimeout($key, $ttl); } // ------------------------------------------------------------------------ @@ -463,6 +465,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle * * Deletes a key * + * @param string $key Redis key * @return bool */ protected function _delete($key) -- cgit v1.2.3-24-g4f1b From 8535d803b8feb252c6f4a14b5e87a47111f1d4a8 Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 14 Aug 2019 03:13:10 +0800 Subject: Adapt to styleguide --- .../Session/drivers/Session_redis_driver.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 1f1004fb9..3323ca6cf 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -240,7 +240,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $this->_session_id = $session_id; } - $this->_expire($this->_lock_key, 300); + $this->_expire_key($this->_lock_key, 300); if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE) { if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration'])) @@ -253,7 +253,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return $this->_fail(); } - return ($this->_expire($this->_key_prefix.$session_id, $this->_config['expiration'])) + return ($this->_expire_key($this->_key_prefix.$session_id, $this->_config['expiration'])) ? $this->_success : $this->_fail(); } @@ -273,7 +273,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { try { $ping = $this->_redis->ping(); - if ($ping === '+PONG' || $ping === TRUE) + if ($ping === '+PONG' OR $ping === TRUE) { $this->_release_lock(); if ($this->_redis->close() === FALSE) @@ -308,7 +308,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { if (isset($this->_redis, $this->_lock_key)) { - if (($result = $this->_delete($this->_key_prefix.$session_id)) !== 1) + if (($result = $this->_delete_key($this->_key_prefix.$session_id)) !== 1) { log_message('debug', 'Session: Redis::del() expected to return 1, got '.var_export($result, TRUE).' instead.'); } @@ -369,7 +369,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // correct session ID. if ($this->_lock_key === $this->_key_prefix.$session_id.':lock') { - return $this->_expire($this->_lock_key, 300); + return $this->_expire_key($this->_lock_key, 300); } // 30 attempts to obtain a lock, in case another request already has it @@ -443,15 +443,15 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // ------------------------------------------------------------------------ /** - * Expire + * Expire key * * Sets expiration for a key * * @param string $key Redis key - * @param int $ttl The key's remaining Time To Live, in seconds. + * @param int $ttl The key's remaining Time To Live, in seconds. * @return bool */ - protected function _expire($key, $ttl) + protected function _expire_key($key, $ttl) { if (method_exists($this->_redis, 'expire')) return $this->_redis->expire($key, $ttl); @@ -461,14 +461,14 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // ------------------------------------------------------------------------ /** - * Delete + * Delete key * * Deletes a key * * @param string $key Redis key * @return bool */ - protected function _delete($key) + protected function _delete_key($key) { if (method_exists($this->_redis, 'del')) return $this->_redis->del($key); -- cgit v1.2.3-24-g4f1b From 1f90f7b985214319b1363d0fa2b497d2a1cd9a8d Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 14 Aug 2019 03:22:16 +0800 Subject: Use version_compare to avoid method checks --- system/libraries/Session/drivers/Session_redis_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 3323ca6cf..66a28ffdc 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -453,7 +453,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected function _expire_key($key, $ttl) { - if (method_exists($this->_redis, 'expire')) + if (version_compare(phpversion('redis'), '5', '>=')) return $this->_redis->expire($key, $ttl); return $this->_redis->setTimeout($key, $ttl); } @@ -470,7 +470,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected function _delete_key($key) { - if (method_exists($this->_redis, 'del')) + if (version_compare(phpversion('redis'), '5', '>=')) return $this->_redis->del($key); return $this->_redis->delete($key); } -- cgit v1.2.3-24-g4f1b From 940819167f58bad7efb87b9dacd91ba44029ab4d Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 14 Aug 2019 18:36:38 +0800 Subject: Define constant PHPREDIS_VERSION --- system/libraries/Session/drivers/Session_redis_driver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 66a28ffdc..1215b3afd 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -37,6 +37,8 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); +define('PHPREDIS_VERSION', phpversion('redis')); + /** * CodeIgniter Session Redis Driver * @@ -453,7 +455,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected function _expire_key($key, $ttl) { - if (version_compare(phpversion('redis'), '5', '>=')) + if (version_compare(PHPREDIS_VERSION, '5', '>=')) return $this->_redis->expire($key, $ttl); return $this->_redis->setTimeout($key, $ttl); } @@ -470,7 +472,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected function _delete_key($key) { - if (version_compare(phpversion('redis'), '5', '>=')) + if (version_compare(PHPREDIS_VERSION, '5', '>=')) return $this->_redis->del($key); return $this->_redis->delete($key); } -- cgit v1.2.3-24-g4f1b From 8ae161944fe2c25e1fc56e845cf66b07d65805dd Mon Sep 17 00:00:00 2001 From: Michael Long Date: Fri, 23 Aug 2019 22:07:43 +0800 Subject: Refactor implementation of #5816 --- .../Session/drivers/Session_redis_driver.php | 77 ++++++++++++++++------ 1 file changed, 56 insertions(+), 21 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 1215b3afd..3ee59a4a2 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -37,8 +37,6 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); -define('PHPREDIS_VERSION', phpversion('redis')); - /** * CodeIgniter Session Redis Driver * @@ -78,6 +76,33 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected $_key_exists = FALSE; + /** + * Name of setTimeout() method in phpRedis + * + * Due to some deprecated methods in phpRedis, we need to call the + * specific methods depending on the version of phpRedis. + * + * @var string + */ + protected $_setTimeout_name; + + /** + * Name of delete() method in phpRedis + * + * Due to some deprecated methods in phpRedis, we need to call the + * specific methods depending on the version of phpRedis. + * + * @var string + */ + protected $_delete_name; + + /** + * Response of ping() method in phpRedis + * + * @var mixed + */ + protected $_ping_response; + // ------------------------------------------------------------------------ /** @@ -90,6 +115,20 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { parent::__construct($params); + // Detect the names of some methods in phpRedis instance + if (version_compare(phpversion('redis'), '5', '>=')) + { + $this->_setTimeout_name = 'expire'; + $this->_delete_name = 'del'; + $this->_ping_response = TRUE; + } + else + { + $this->_setTimeout_name = 'setTimeout'; + $this->_delete_name = 'delete'; + $this->_ping_response = '+PONG'; + } + if (empty($this->_config['save_path'])) { log_message('error', 'Session: No Redis save path configured.'); @@ -170,8 +209,8 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle } else { - $this->php5_validate_id(); $this->_redis = $redis; + $this->php5_validate_id(); return $this->_success; } } @@ -242,7 +281,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $this->_session_id = $session_id; } - $this->_expire_key($this->_lock_key, 300); + $this->_setTimeout($this->_lock_key, 300); if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE) { if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration'])) @@ -255,7 +294,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return $this->_fail(); } - return ($this->_expire_key($this->_key_prefix.$session_id, $this->_config['expiration'])) + return ($this->_setTimeout($this->_key_prefix.$session_id, $this->_config['expiration'])) ? $this->_success : $this->_fail(); } @@ -275,7 +314,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { try { $ping = $this->_redis->ping(); - if ($ping === '+PONG' OR $ping === TRUE) + if ($ping === $this->_ping_response) { $this->_release_lock(); if ($this->_redis->close() === FALSE) @@ -310,9 +349,9 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { if (isset($this->_redis, $this->_lock_key)) { - if (($result = $this->_delete_key($this->_key_prefix.$session_id)) !== 1) + if (($result = $this->_delete($this->_key_prefix.$session_id)) !== 1) { - log_message('debug', 'Session: Redis::del() expected to return 1, got '.var_export($result, TRUE).' instead.'); + log_message('debug', 'Session: Redis::'.$this->_delete_name.'() expected to return 1, got '.var_export($result, TRUE).' instead.'); } $this->_cookie_destroy(); @@ -371,7 +410,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // correct session ID. if ($this->_lock_key === $this->_key_prefix.$session_id.':lock') { - return $this->_expire_key($this->_lock_key, 300); + return $this->_setTimeout($this->_lock_key, 300); } // 30 attempts to obtain a lock, in case another request already has it @@ -429,7 +468,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { if (isset($this->_redis, $this->_lock_key) && $this->_lock) { - if ( ! $this->_redis->delete($this->_lock_key)) + if ( ! $this->_delete($this->_lock_key)) { log_message('error', 'Session: Error while trying to free lock for '.$this->_lock_key); return FALSE; @@ -445,7 +484,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // ------------------------------------------------------------------------ /** - * Expire key + * Set timeout * * Sets expiration for a key * @@ -453,28 +492,24 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle * @param int $ttl The key's remaining Time To Live, in seconds. * @return bool */ - protected function _expire_key($key, $ttl) + protected function _setTimeout($key, $ttl) { - if (version_compare(PHPREDIS_VERSION, '5', '>=')) - return $this->_redis->expire($key, $ttl); - return $this->_redis->setTimeout($key, $ttl); + return $this->_redis->{$this->_setTimeout_name}($key, $ttl); } // ------------------------------------------------------------------------ /** - * Delete key + * Delete * * Deletes a key * - * @param string $key Redis key + * @param string $key Redis key * @return bool */ - protected function _delete_key($key) + protected function _delete($key) { - if (version_compare(PHPREDIS_VERSION, '5', '>=')) - return $this->_redis->del($key); - return $this->_redis->delete($key); + return $this->_redis->{$this->_delete_name}($key); } } -- cgit v1.2.3-24-g4f1b From a9f13251df09ceb179ce6a9f6440a6869e779bba Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 4 Sep 2019 01:11:04 +0800 Subject: Delete unnecessary functions --- .../Session/drivers/Session_redis_driver.php | 44 +++------------------- 1 file changed, 6 insertions(+), 38 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 3ee59a4a2..ea70e4946 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -281,7 +281,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $this->_session_id = $session_id; } - $this->_setTimeout($this->_lock_key, 300); + $this->_redis->{$this->_setTimeout_name}($this->_lock_key, 300); if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE) { if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration'])) @@ -294,7 +294,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return $this->_fail(); } - return ($this->_setTimeout($this->_key_prefix.$session_id, $this->_config['expiration'])) + return ($this->_redis->{$this->_setTimeout_name}($this->_key_prefix.$session_id, $this->_config['expiration'])) ? $this->_success : $this->_fail(); } @@ -313,8 +313,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle if (isset($this->_redis)) { try { - $ping = $this->_redis->ping(); - if ($ping === $this->_ping_response) + if ($this->_redis->ping() === $this->_ping_response) { $this->_release_lock(); if ($this->_redis->close() === FALSE) @@ -349,7 +348,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { if (isset($this->_redis, $this->_lock_key)) { - if (($result = $this->_delete($this->_key_prefix.$session_id)) !== 1) + if (($result = $this->_redis->{$this->_delete_name}($this->_key_prefix.$session_id)) !== 1) { log_message('debug', 'Session: Redis::'.$this->_delete_name.'() expected to return 1, got '.var_export($result, TRUE).' instead.'); } @@ -410,7 +409,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle // correct session ID. if ($this->_lock_key === $this->_key_prefix.$session_id.':lock') { - return $this->_setTimeout($this->_lock_key, 300); + return $this->_redis->{$this->_setTimeout_name}($this->_lock_key, 300); } // 30 attempts to obtain a lock, in case another request already has it @@ -468,7 +467,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { if (isset($this->_redis, $this->_lock_key) && $this->_lock) { - if ( ! $this->_delete($this->_lock_key)) + if ( ! $this->_redis->{$this->_delete_name}($this->_lock_key)) { log_message('error', 'Session: Error while trying to free lock for '.$this->_lock_key); return FALSE; @@ -481,35 +480,4 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return TRUE; } - // ------------------------------------------------------------------------ - - /** - * Set timeout - * - * Sets expiration for a key - * - * @param string $key Redis key - * @param int $ttl The key's remaining Time To Live, in seconds. - * @return bool - */ - protected function _setTimeout($key, $ttl) - { - return $this->_redis->{$this->_setTimeout_name}($key, $ttl); - } - - // ------------------------------------------------------------------------ - - /** - * Delete - * - * Deletes a key - * - * @param string $key Redis key - * @return bool - */ - protected function _delete($key) - { - return $this->_redis->{$this->_delete_name}($key); - } - } -- cgit v1.2.3-24-g4f1b From b373b9b099a5df0b180128d83fb3bf3f44877280 Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 4 Sep 2019 01:13:50 +0800 Subject: Rename to _ping_success --- system/libraries/Session/drivers/Session_redis_driver.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index ea70e4946..cb6bf3645 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -97,11 +97,11 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle protected $_delete_name; /** - * Response of ping() method in phpRedis + * Success return value of ping() method in phpRedis * * @var mixed */ - protected $_ping_response; + protected $_ping_success; // ------------------------------------------------------------------------ @@ -120,13 +120,13 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle { $this->_setTimeout_name = 'expire'; $this->_delete_name = 'del'; - $this->_ping_response = TRUE; + $this->_ping_success = TRUE; } else { $this->_setTimeout_name = 'setTimeout'; $this->_delete_name = 'delete'; - $this->_ping_response = '+PONG'; + $this->_ping_success = '+PONG'; } if (empty($this->_config['save_path'])) @@ -313,7 +313,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle if (isset($this->_redis)) { try { - if ($this->_redis->ping() === $this->_ping_response) + if ($this->_redis->ping() === $this->_ping_success) { $this->_release_lock(); if ($this->_redis->close() === FALSE) -- cgit v1.2.3-24-g4f1b From e5175991d6b8488f7e6ef37dbd2771b4f210a574 Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 4 Sep 2019 01:14:49 +0800 Subject: revert: Alter php_validate_id() --- system/libraries/Session/drivers/Session_redis_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index cb6bf3645..3a5b34e69 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -209,8 +209,8 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle } else { - $this->_redis = $redis; $this->php5_validate_id(); + $this->_redis = $redis; return $this->_success; } } -- cgit v1.2.3-24-g4f1b