From e20318c32dd1c03ebdf8aa1b4bb31ae37a978933 Mon Sep 17 00:00:00 2001 From: Zh Zh Zh Date: Tue, 10 Dec 2024 11:13:49 +0300 Subject: [PATCH] Update File.php When reading a file line by line, PHP ALWAYS returns false when reading the whole file. So the current driver code ALWAYS throws an exception. It should not work this way, the end of the file should not throw an exception. --- .../Magento/Framework/Filesystem/Driver/File.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index 10b95caa09333..710bcb3b82b99 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -682,15 +682,8 @@ public function fileOpen($path, $mode) public function fileReadLine($resource, $length, $ending = null) { // phpcs:disable - $result = @stream_get_line($resource, $length, $ending); + return @stream_get_line($resource, $length, $ending); // phpcs:enable - if (false === $result) { - throw new FileSystemException( - new Phrase('File cannot be read %1', [$this->getWarningMessage()]) - ); - } - - return $result; } /**