Skip to content

Commit

Permalink
Revert "merged branch gajdaw/finder_splfileinfo_fpassthu (PR #4751)" …
Browse files Browse the repository at this point in the history
…(closes #6224)

This reverts commit 5608c0c3ee21e6aade3170d6c580bf7ad452a143, reversing
changes made to 38c30b71bd2d32ac31920996480d1706402118f2.

Conflicts:
	src/Symfony/Component/Finder/SplFileInfo.php
  • Loading branch information
fabpot committed Dec 10, 2012
1 parent 5910fce commit d9cc0a8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SplFileInfo.php
Expand Up @@ -62,10 +62,14 @@ public function getRelativePathname()
*/
public function getContents()
{
$file = new \SplFileObject($this->getRealpath(), 'rb');
ob_start();
$file->fpassthru();
$level = error_reporting(0);
$content = file_get_contents($this->getRealpath());
error_reporting($level);
if (false === $content) {
$error = error_get_last();
throw new \RuntimeException($error['message']);
}

return ob_get_clean();
return $content;
}
}

0 comments on commit d9cc0a8

Please sign in to comment.