mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
⬆️ N°4770 Update to latest Symfony 3.4
This commit is contained in:
10
lib/symfony/cache/Traits/ApcuTrait.php
vendored
10
lib/symfony/cache/Traits/ApcuTrait.php
vendored
@@ -23,13 +23,13 @@ trait ApcuTrait
|
||||
{
|
||||
public static function isSupported()
|
||||
{
|
||||
return \function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN);
|
||||
return \function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
private function init($namespace, $defaultLifetime, $version)
|
||||
{
|
||||
if (!static::isSupported()) {
|
||||
throw new CacheException('APCu is not enabled');
|
||||
throw new CacheException('APCu is not enabled.');
|
||||
}
|
||||
if ('cli' === \PHP_SAPI) {
|
||||
ini_set('apc.use_request_time', 0);
|
||||
@@ -58,7 +58,7 @@ trait ApcuTrait
|
||||
}
|
||||
}
|
||||
} catch (\Error $e) {
|
||||
throw new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
|
||||
throw new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ trait ApcuTrait
|
||||
*/
|
||||
protected function doClear($namespace)
|
||||
{
|
||||
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))
|
||||
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY))
|
||||
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN))
|
||||
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), \APC_ITER_KEY))
|
||||
: apcu_clear_cache();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user