Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd2c4c5

Browse files
committed
minor #27249 [HttpKernel] do file_exists() check instead of silent notice (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [HttpKernel] do file_exists() check instead of silent notice | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27234 | License | MIT | Doc PR | - Commits ------- f8cde70 [HttpKernel] do file_exists() check instead of silent notice
2 parents 81cef4b + f8cde70 commit dd2c4c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ protected function initializeContainer()
587587
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
588588
$fresh = $oldContainer = false;
589589
try {
590-
if (\is_object($this->container = include $cache->getPath())) {
590+
if (file_exists($cache->getPath()) && \is_object($this->container = include $cache->getPath())) {
591591
$this->container->set('kernel', $this);
592592
$oldContainer = $this->container;
593593
$fresh = true;
@@ -650,7 +650,7 @@ protected function initializeContainer()
650650
}
651651
}
652652

653-
if (null === $oldContainer) {
653+
if (null === $oldContainer && file_exists($cache->getPath())) {
654654
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
655655
try {
656656
$oldContainer = include $cache->getPath();

0 commit comments

Comments
 (0)