]> git.mxchange.org Git - friendica.git/commitdiff
Fix config value type in MemcachedCacheDriver
authorHypolite Petovan <mrpetovan@gmail.com>
Tue, 17 Jul 2018 06:05:06 +0000 (02:05 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Tue, 17 Jul 2018 06:05:06 +0000 (02:05 -0400)
- Remove default config values set in CacheDriverFactory

src/Core/Cache/CacheDriverFactory.php
src/Core/Cache/MemcachedCacheDriver.php

index 8fbdc1549e3cca434782cb7e8e10f9b5766a19d5..307f52a2ea14cf6453fae14021cf9f8d6ce72cf5 100644 (file)
@@ -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;
index 8b752fb3a8b8cb585566feec1913c3449f780914..4397892a9eeda6d24fee65d4e282deb0f27ff987 100644 (file)
@@ -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);