summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers/Cache_redis.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_redis.php')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index f2a41cc67..a35fbf6d2 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -111,7 +111,7 @@ class CI_Cache_redis extends CI_Driver
{
if (is_array($data) OR is_object($data))
{
- if ( ! $this->_redis->sAdd('_ci_redis_serialized', $id))
+ if ( ! $this->_redis->sIsMember('_ci_redis_serialized', $id) && ! $this->_redis->sAdd('_ci_redis_serialized', $id))
{
return FALSE;
}
@@ -243,15 +243,13 @@ class CI_Cache_redis extends CI_Driver
*/
public function is_supported()
{
- if (extension_loaded('redis'))
- {
- return $this->_setup_redis();
- }
- else
+ if ( ! extension_loaded('redis'))
{
log_message('debug', 'The Redis extension must be loaded to use Redis cache.');
return FALSE;
}
+
+ return $this->_setup_redis();
}
// ------------------------------------------------------------------------