From c7b119b50af14fc372e473f07ec22b03a46556b9 Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Thu, 23 Jan 2025 07:58:58 +0100 Subject: [PATCH] BUGFIX: Silence warning in `readCacheFile()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit readCacheFile() in SimpleFileBackend does fopen(). It wraps it into a try-catch clause and checks the result, but it still produces a warning if the file does not exist: `Warning: fopen(/application/Data/Temporary/…): Failed to open stream: No such file or directory` The only way to suppress that warning is to use the shut-up operator (`@`) in this place. Given that everything that can go wrong here is taken care of, I think this is fine. --- Neos.Cache/Classes/Backend/SimpleFileBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Cache/Classes/Backend/SimpleFileBackend.php b/Neos.Cache/Classes/Backend/SimpleFileBackend.php index 7fcef5e67c..6f3e346b0b 100644 --- a/Neos.Cache/Classes/Backend/SimpleFileBackend.php +++ b/Neos.Cache/Classes/Backend/SimpleFileBackend.php @@ -498,7 +498,7 @@ protected function readCacheFile(string $cacheEntryPathAndFilename, int $offset for ($i = 0; $i < 3; $i++) { $data = false; try { - $file = fopen($cacheEntryPathAndFilename, 'rb'); + $file = @fopen($cacheEntryPathAndFilename, 'rb'); if ($file === false) { continue; }