mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
⬆️ N°4770 Update to latest Symfony 3.4
This commit is contained in:
11
lib/symfony/cache/Adapter/ChainAdapter.php
vendored
11
lib/symfony/cache/Adapter/ChainAdapter.php
vendored
@@ -46,6 +46,9 @@ class ChainAdapter implements AdapterInterface, PruneableInterface, ResettableIn
|
||||
if (!$adapter instanceof CacheItemPoolInterface) {
|
||||
throw new InvalidArgumentException(sprintf('The class "%s" does not implement the "%s" interface.', \get_class($adapter), CacheItemPoolInterface::class));
|
||||
}
|
||||
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $adapter instanceof ApcuAdapter && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
|
||||
continue; // skip putting APCu in the chain when the backend is disabled
|
||||
}
|
||||
|
||||
if ($adapter instanceof AdapterInterface) {
|
||||
$this->adapters[] = $adapter;
|
||||
@@ -58,14 +61,10 @@ class ChainAdapter implements AdapterInterface, PruneableInterface, ResettableIn
|
||||
$this->syncItem = \Closure::bind(
|
||||
static function ($sourceItem, $item) use ($defaultLifetime) {
|
||||
$item->value = $sourceItem->value;
|
||||
$item->expiry = $sourceItem->expiry;
|
||||
$item->isHit = $sourceItem->isHit;
|
||||
|
||||
if (0 < $sourceItem->defaultLifetime && $sourceItem->defaultLifetime < $defaultLifetime) {
|
||||
$defaultLifetime = $sourceItem->defaultLifetime;
|
||||
}
|
||||
if (0 < $defaultLifetime && ($item->defaultLifetime <= 0 || $defaultLifetime < $item->defaultLifetime)) {
|
||||
$item->defaultLifetime = $defaultLifetime;
|
||||
if (0 < $defaultLifetime) {
|
||||
$item->expiresAfter($defaultLifetime);
|
||||
}
|
||||
|
||||
return $item;
|
||||
|
||||
Reference in New Issue
Block a user