8000 minor #41412 [HttpKernel] Fixes file_get_content in HttpCache's Store… · symfony/symfony@12030e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12030e5

Browse files
minor #41412 [HttpKernel] Fixes file_get_content in HttpCache's Store for PHP7.4+ (0x346e3730)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel] Fixes file_get_content in HttpCache's Store for PHP7.4+ | Q | A | ------------- | - 8000 -- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - While trying to get 6.0 branch tests green, I encountered an error on multiple HttpKernel tests. After investigating, it comes from the file_get_contents in the load method of the Store class from HttpCache. For obscure reasons, some calls are in errors and the content can't be read for "permission denied". This is happening only on PHP 7.4.0+ (and that explains why the tests are green on the branch 5.4 as it runs php 7.2), adding the `@` error suppressor fixes this. Commits ------- c3ac11c [HttpKernel] Fixes tests for PHP7.4+
2 parents 26d682f + c3ac11c commit 12030e5

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Component/HttpKernel/HttpCache

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/HttpCache/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private function load(string $key): ?string
349349
{
350350
$path = $this->getPath($key);
351351

352-
return file_exists($path) && false !== ($contents = file_get_contents($path)) ? $contents : null;
352+
return file_exists($path) && false !== ($contents = @file_get_contents($path)) ? $contents : null;
353353
}
354354

355355
/**

0 commit comments

Comments
 (0)
0