From 31cfac1cfa7067cfdad57aeb58d90863c9aed973 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Tue, 13 Aug 2019 08:32:08 +0200 Subject: [PATCH 1/2] Fix Redis test - Check if $redis_port is null --- src/Core/Cache/RedisCache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Core/Cache/RedisCache.php b/src/Core/Cache/RedisCache.php index 5f8fd7e4c..813c91b15 100644 --- a/src/Core/Cache/RedisCache.php +++ b/src/Core/Cache/RedisCache.php @@ -37,8 +37,10 @@ class RedisCache extends Cache implements IMemoryCache $redis_pw = $config->get('system', 'redis_password'); $redis_db = $config->get('system', 'redis_db', 0); - if (!$this->redis->connect($redis_host, $redis_port)) { + if (isset($redis_port) && !$this->redis->connect($redis_host, $redis_port)) { throw new Exception('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available'); + } elseif (!$this->redis->connect($redis_host)) { + throw new Exception('Expected Redis server at ' . $redis_host . ' isn\'t available'); } if (isset($redis_pw) && !$this->redis->auth($redis_pw)) { From b28e11fee8427bfc8a7de7ff6e5f22954cd325eb Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Tue, 13 Aug 2019 08:54:26 +0200 Subject: [PATCH 2/2] - Remove deprecated Redis::delete() function --- src/Core/Cache/RedisCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Cache/RedisCache.php b/src/Core/Cache/RedisCache.php index 813c91b15..b2638c49f 100644 --- a/src/Core/Cache/RedisCache.php +++ b/src/Core/Cache/RedisCache.php @@ -122,7 +122,7 @@ class RedisCache extends Cache implements IMemoryCache public function delete($key) { $cachekey = $this->getCacheKey($key); - return ($this->redis->delete($cachekey) > 0); + return ($this->redis->del($cachekey) > 0); } /**