8000 [HttpKernel] do is_file check before include · symfony/symfony@8efcc17 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8efcc17

Browse files
committed
[HttpKernel] do is_file check before include
Trying to include a file that doesn't exist issues a warning. Doing an is_file check beforehand should prevent those warnings.
1 parent 5dd56a6 commit 8efcc17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ protected function initializeContainer()
533533
if (!flock($lock, $wouldBlock ? \LOCK_SH : \LOCK_EX)) {
534534
fclose($lock);
535535
$lock = null;
536-
} elseif (!\is_object($this->container = include $cachePath)) {
536+
} elseif (!is_file($cachePath) || !\is_object($this->container = include $cachePath)) {
537537
$this->container = null;
538538
} elseif (!$oldContainer || \get_class($this->container) !== $oldContainer->name) {
539539
flock($lock, \LOCK_UN);

0 commit comments

Comments
 (0)
0