From 7ca3c8d48a81fee3d8e3215d591173d72c95416b Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Wed, 21 Jun 2023 22:40:41 +0200 Subject: [PATCH] Fix self:: calls Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/Memcache/Redis.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index de67d9cf45138..38549511392a4 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -87,11 +87,11 @@ public function set($key, $value, $ttl = 0) { } public function hasKey($key) { - return (bool)self::$cache->exists($this->getPrefix() . $key); + return (bool)$this->getCache()->exists($this->getPrefix() . $key); } public function remove($key) { - if (self::$cache->del($this->getPrefix() . $key)) { + if ($this->getCache()->unlink($this->getPrefix() . $key)) { return true; } else { return false; @@ -101,8 +101,8 @@ public function remove($key) { public function clear($prefix = '') { // TODO: this is slow and would fail with Redis cluster $prefix = $this->getPrefix() . $prefix . '*'; - $keys = self::$cache->keys($prefix); - $deleted = self::$cache->del($keys); + $keys = this->getCache()->keys($prefix); + $deleted = $this->getCache()->del($keys); return (is_array($keys) && (count($keys) === $deleted)); } @@ -134,7 +134,7 @@ public function add($key, $value, $ttl = 0) { * @return int | bool */ public function inc($key, $step = 1) { - return self::$cache->incrBy($this->getPrefix() . $key, $step); + return $this->getCache()->incrBy($this->getPrefix() . $key, $step); } /** @@ -178,7 +178,7 @@ public function cad($key, $old) { } public function setTTL($key, $ttl) { - self::$cache->expire($this->getPrefix() . $key, $ttl); + $this->getCache()->expire($this->getPrefix() . $key, $ttl); } public static function isAvailable(): bool {