diff --git a/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php b/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php index 0a3887eba091..6687bd4272d1 100644 --- a/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php @@ -21,7 +21,7 @@ class ApcuAdapter extends AbstractAdapter { public static function isSupported() { - return function_exists('apcu_fetch') && ini_get('apc.enabled') && !('cli' === PHP_SAPI && !ini_get('apc.enable_cli')); + return function_exists('apcu_fetch') && ini_get('apc.enabled'); } public function __construct($namespace = '', $defaultLifetime = 0, $version = null) @@ -69,7 +69,7 @@ protected function doHave($id) */ protected function doClear($namespace) { - return isset($namespace[0]) && class_exists('APCuIterator', false) + return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== PHP_SAPI || ini_get('apc.enable_cli')) ? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY)) : apcu_clear_cache(); } diff --git a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php b/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php index befa38d8d46d..88107cb9899d 100644 --- a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php @@ -26,7 +26,7 @@ class PhpFilesAdapter extends AbstractAdapter public static function isSupported() { - return function_exists('opcache_compile_file') && ini_get('opcache.enable'); + return function_exists('opcache_invalidate') && ini_get('opcache.enable'); } public function __construct($namespace = '', $defaultLifetime = 0, $directory = null) @@ -118,7 +118,7 @@ protected function doSave(array $values, $lifetime) $ok = $this->write($file, '