X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FCache%2FRedisCache.php;h=3558a38464ca9c20acdf343b04e31b1a207c9c04;hb=cbe435bb708ccf17a4b5bea1e20c3258c9524700;hp=5f8fd7e4ce35b56c872930f08899b443deb8b863;hpb=6b7dfd0c712bc89de955a735fcbca60dc973d71d;p=friendica.git diff --git a/src/Core/Cache/RedisCache.php b/src/Core/Cache/RedisCache.php index 5f8fd7e4ce..3558a38464 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)) { @@ -120,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); } /**