forked from extern/egroupware
fix "PHP Fatal error: APCuIterator::__construct(): APC must be enabled to use" in setup-cli
This commit is contained in:
parent
02c56ba537
commit
868d84c411
@ -151,6 +151,11 @@ class Apcu extends Base implements Provider
|
||||
*/
|
||||
function flush(array $keys)
|
||||
{
|
||||
// do NOT try instanciating APCuIterator, if APCu is not enabled, as it gives a PHP Fatal Error
|
||||
if (!ini_get('apc.enabled') || php_sapi_name() === 'cli' && !ini_get('apc.cli_enabled'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!$keys && function_exists('apcu_clear_cache'))
|
||||
{
|
||||
apcu_clear_cache();
|
||||
|
Loading…
Reference in New Issue
Block a user