From 5913550eec2523d1b8df860dbacdd03f3d92357f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 9 Aug 2016 18:29:47 +0200 Subject: [PATCH] Fixed build when memcached is not enabled in PHP 7.1 --- module/Common/src/Factory/CacheFactory.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/Common/src/Factory/CacheFactory.php b/module/Common/src/Factory/CacheFactory.php index 905ebf56..1add99dd 100644 --- a/module/Common/src/Factory/CacheFactory.php +++ b/module/Common/src/Factory/CacheFactory.php @@ -59,6 +59,10 @@ class CacheFactory implements FactoryInterface case Cache\PhpFileCache::class: return new $cacheConfig['adapter']($cacheConfig['options']['dir']); case Cache\MemcachedCache::class: + if (! class_exists(\Memcached::class)) { + return new Cache\ArrayCache(); + } + $memcached = new \Memcached(); $servers = isset($cacheConfig['options']['servers']) ? $cacheConfig['options']['servers'] : [];