summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Cache/drivers')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php15
1 files changed, 3 insertions, 12 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index 37596189a..8a7df7abd 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -135,10 +135,6 @@ class CI_Cache_redis extends CI_Driver
{
log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')');
}
-
- // Initialize the index of serialized values.
- $serialized = $this->_redis->sMembers('_ci_redis_serialized');
- empty($serialized) OR $this->_serialized = array_flip($serialized);
}
// ------------------------------------------------------------------------
@@ -153,7 +149,7 @@ class CI_Cache_redis extends CI_Driver
{
$value = $this->_redis->get($key);
- if ($value !== FALSE && isset($this->_serialized[$key]))
+ if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key))
{
return unserialize($value);
}
@@ -184,9 +180,8 @@ class CI_Cache_redis extends CI_Driver
isset($this->_serialized[$id]) OR $this->_serialized[$id] = TRUE;
$data = serialize($data);
}
- elseif (isset($this->_serialized[$id]))
+ else
{
- $this->_serialized[$id] = NULL;
$this->_redis->sRemove('_ci_redis_serialized', $id);
}
@@ -208,11 +203,7 @@ class CI_Cache_redis extends CI_Driver
return FALSE;
}
- if (isset($this->_serialized[$key]))
- {
- $this->_serialized[$key] = NULL;
- $this->_redis->sRemove('_ci_redis_serialized', $key);
- }
+ $this->_redis->sRemove('_ci_redis_serialized', $key);
return TRUE;
}