Skip to content

Commit a1734dd

Browse files
committed
Revert "merged branch gajdaw/finder_splfileinfo_fpassthu (PR #4751)" (closes #6224)
This reverts commit 5608c0c, reversing changes made to 38c30b7. Conflicts: src/Symfony/Component/Finder/SplFileInfo.php
1 parent 947a48d commit a1734dd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Symfony/Component/Finder/SplFileInfo.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ public function getRelativePathname()
6262
*/
6363
public function getContents()
6464
{
65-
$file = new \SplFileObject($this->getRealpath(), 'rb');
66-
ob_start();
67-
$file->fpassthru();
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+
}
6872

69-
return ob_get_clean();
73+
return $content;
7074
}
7175
}

0 commit comments

Comments
 (0)