Skip to content

Commit

Permalink
[Component][Finder][SplFileInfo] file_get_contents=>fpassthru
Browse files Browse the repository at this point in the history
  • Loading branch information
gajdaw committed Jul 4, 2012
1 parent 000d54c commit b4d7a7e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Symfony/Component/Finder/SplFileInfo.php
Expand Up @@ -62,14 +62,9 @@ public function getRelativePathname()
*/
public function getContents()
{
$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 $content;
$file = new \SplFileObject($this->getRealpath(), "rb");
ob_start();
$file->fpassthru();
return ob_get_clean();
}
}

0 comments on commit b4d7a7e

Please sign in to comment.