diff options
author | Scott Dutton <scott.dutton@sykescottages.co.uk> | 2019-05-08 09:27:22 +0200 |
---|---|---|
committer | Scott Dutton <scott.dutton@sykescottages.co.uk> | 2019-05-08 09:27:22 +0200 |
commit | c7c8673517cf4bde03bf68badd4cbf6770ea66d5 (patch) | |
tree | 764332916b7f3086495704b0a72705e2490ba48b /system/libraries | |
parent | 687e3728250ec74946050b04a384546fedf1fe70 (diff) |
Alterntive redis fix
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_redis.php | 15 |
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; } |