Permalink
Browse files

[Component][Finder][SplFileInfo] file_get_contents=>fpassthru

  • Loading branch information...
1 parent 000d54c commit b4d7a7e8f654e20449cd43d1de18bf99696bbcec @gajdaw committed Jun 21, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −9 src/Symfony/Component/Finder/SplFileInfo.php
@@ -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.