Skip to content

Commit b4d7a7e

Browse files
committed
[Component][Finder][SplFileInfo] file_get_contents=>fpassthru
1 parent 000d54c commit b4d7a7e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Symfony/Component/Finder/SplFileInfo.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,9 @@ public function getRelativePathname()
6262
*/
6363
public function getContents()
6464
{
65-
$level = error_reporting(0);
66-
$content = file_get_contents($this->getRealpath());
67-
error_reporting($level);
68-
if (false === $content) {
69-
$error = error_get_last();
70-
throw new \RuntimeException($error['message']);
71-
}
72-
73-
return $content;
65+
$file = new \SplFileObject($this->getRealpath(), "rb");
66+
ob_start();
67+
$file->fpassthru();
68+
return ob_get_clean();
7469
}
7570
}

0 commit comments

Comments
 (0)