diff --git a/api/src/Cache.php b/api/src/Cache.php index ba34282990..c859e0f6a5 100644 --- a/api/src/Cache.php +++ b/api/src/Cache.php @@ -769,9 +769,10 @@ class Cache if (is_null(Cache::$default_provider)) { Cache::$default_provider = - function_exists('apcu_fetch') && Cache\Apcu::available() ? 'EGroupware\Api\Cache\Apcu' : - (function_exists('apc_fetch') && Cache\Apc::available() ? 'EGroupware\Api\Cache\Apc' : - 'EGroupware\Api\Cache\Files'); + PHP_SAPI === 'cli' ? 'EGroupware\Api\Cache\Files' : + (function_exists('apcu_fetch') && Cache\Apcu::available() ? 'EGroupware\Api\Cache\Apcu' : + (function_exists('apc_fetch') && Cache\Apc::available() ? 'EGroupware\Api\Cache\Apc' : + 'EGroupware\Api\Cache\Files')); } //error_log('Cache::$default_provider='.array2string(Cache::$default_provider)); diff --git a/api/src/Cache/Memcache.php b/api/src/Cache/Memcache.php index 8523e92d50..d1f3819b0a 100644 --- a/api/src/Cache/Memcache.php +++ b/api/src/Cache/Memcache.php @@ -13,6 +13,9 @@ namespace EGroupware\Api\Cache; +// fix warning in tests, if memcache extension not available +if (defined('MEMCACHE_COMPRESSED')) define('MEMCACHE_COMPRESSED', 2); + /** * Caching provider storing data in memcached via PHP's memcache extension *