]> git.mxchange.org Git - friendica.git/commitdiff
Fix Redis test
authorPhilipp Holzer <admin+github@philipp.info>
Tue, 13 Aug 2019 06:32:08 +0000 (08:32 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Tue, 13 Aug 2019 06:32:08 +0000 (08:32 +0200)
- Check if $redis_port is null

src/Core/Cache/RedisCache.php

index 5f8fd7e4ce35b56c872930f08899b443deb8b863..813c91b155865765f1cf4bc354e4f65764e64477 100644 (file)
@@ -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)) {