Revert "merged branch gajdaw/finder_splfileinfo_fpassthu (PR #4751)" (closes #6224)

This reverts commit 5608c0c3ee, reversing
changes made to 38c30b71bd.

Conflicts:
	src/Symfony/Component/Finder/SplFileInfo.php
This commit is contained in:
Fabien Potencier 2012-12-10 13:46:43 +01:00
parent 947a48dbf6
commit a1734ddf72
1 changed files with 8 additions and 4 deletions

View File

@ -62,10 +62,14 @@ class SplFileInfo extends \SplFileInfo
*/
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;
}
}