From: Hypolite Petovan Date: Tue, 17 Jul 2018 06:05:06 +0000 (-0400) Subject: Fix config value type in MemcachedCacheDriver X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7b8efcc23d68e34c547b3c2910e41d77c6b59c96;p=friendica.git Fix config value type in MemcachedCacheDriver - Remove default config values set in CacheDriverFactory --- diff --git a/src/Core/Cache/CacheDriverFactory.php b/src/Core/Cache/CacheDriverFactory.php index 8fbdc1549e..307f52a2ea 100644 --- a/src/Core/Cache/CacheDriverFactory.php +++ b/src/Core/Cache/CacheDriverFactory.php @@ -24,20 +24,20 @@ class CacheDriverFactory switch ($driver) { case 'memcache': - $memcache_host = Config::get('system', 'memcache_host', '127.0.0.1'); - $memcache_port = Config::get('system', 'memcache_port', 11211); + $memcache_host = Config::get('system', 'memcache_host'); + $memcache_port = Config::get('system', 'memcache_port'); return new MemcacheCacheDriver($memcache_host, $memcache_port); break; case 'memcached': - $memcached_hosts = Config::get('system', 'memcached_hosts', [['127.0.0.1', 11211]]); + $memcached_hosts = Config::get('system', 'memcached_hosts'); return new MemcachedCacheDriver($memcached_hosts); break; case 'redis': - $redis_host = Config::get('system', 'redis_host', '127.0.0.1'); - $redis_port = Config::get('system', 'redis_port', 6379); + $redis_host = Config::get('system', 'redis_host'); + $redis_port = Config::get('system', 'redis_port'); return new RedisCacheDriver($redis_host, $redis_port); break; diff --git a/src/Core/Cache/MemcachedCacheDriver.php b/src/Core/Cache/MemcachedCacheDriver.php index 8b752fb3a8..4397892a9e 100644 --- a/src/Core/Cache/MemcachedCacheDriver.php +++ b/src/Core/Cache/MemcachedCacheDriver.php @@ -41,7 +41,9 @@ class MemcachedCacheDriver extends AbstractCacheDriver implements IMemoryCacheDr $this->memcached = new Memcached(); array_walk($memcached_hosts, function (&$value) { - $value = array_map('trim', explode(',', $value)); + if (is_string($value)) { + $value = array_map('trim', explode(',', $value)); + } }); $this->memcached->addServers($memcached_hosts);