summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2020-01-28 20:16:56 +0100
committerAndrey Andreev <narf@devilix.net>2020-01-28 20:16:56 +0100
commit2b96e73d85365fb05a56e7464cdb341fd5a9d7b8 (patch)
tree7e6a7d5805e1a94abe92f7db43727da739877aed /system/libraries/Cache
parentddfe81730f43b20092383165911c5b1c92d4e5f3 (diff)
parentced499f7ad90ff8bb6bf0faa2e24a1593204de9a (diff)
Merge branch '3.1-stable' into develop
Conflicts resolved: .travis.yml system/database/DB_query_builder.php system/helpers/captcha_helper.php system/libraries/Cache/drivers/Cache_redis.php system/libraries/Zip.php
Diffstat (limited to 'system/libraries/Cache')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php27
1 files changed, 22 insertions, 5 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index 9dbe52844..9b082d11b 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -77,6 +77,13 @@ class CI_Cache_redis extends CI_Driver
*/
protected static $_delete_name;
+ /**
+ * sRem()/sRemove() method name depending on phpRedis version
+ *
+ * @var string
+ */
+ protected static $_sRemove_name;
+
// ------------------------------------------------------------------------
/**
@@ -98,9 +105,19 @@ class CI_Cache_redis extends CI_Driver
return;
}
- isset(static::$_delete_name) OR static::$_delete_name = version_compare(phpversion('redis'), '5', '>=')
- ? 'del'
- : 'delete';
+ if ( ! isset(static::$_delete_name, static::$_sRemove_name))
+ {
+ if (version_compare(phpversion('redis'), '5', '>='))
+ {
+ static::$_delete_name = 'del';
+ static::$_sRemove_name = 'sRem';
+ }
+ else
+ {
+ static::$_delete_name = 'delete';
+ static::$_sRemove_name = 'sRemove';
+ }
+ }
$CI =& get_instance();
@@ -210,7 +227,7 @@ class CI_Cache_redis extends CI_Driver
}
else
{
- $this->_redis->sRemove('_ci_redis_serialized', $id);
+ $this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $id);
}
return TRUE;
@@ -231,7 +248,7 @@ class CI_Cache_redis extends CI_Driver
return FALSE;
}
- $this->_redis->sRemove('_ci_redis_serialized', $key);
+ $this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $key);
return TRUE;
}