[HttpKernel] Don't cache "not-fresh" state

This commit is contained in:
Nicolas Grekas 2019-11-25 10:10:24 +01:00
parent 350e1100d5
commit be80db3dc8

View File

@ -514,8 +514,9 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
try {
if (file_exists($cachePath) && \is_object($this->container = include $cachePath)
&& (!$this->debug || (self::$freshCache[$k = $cachePath.'.'.$this->environment] ?? self::$freshCache[$k] = $cache->isFresh()))
&& (!$this->debug || (self::$freshCache[$cachePath] ?? $cache->isFresh()))
) {
self::$freshCache[$cachePath] = true;
$this->container->set('kernel', $this);
error_reporting($errorLevel);