[Component][Finder][SplFileInfo] file_get_contents=>fpassthru
This commit is contained in:
parent
000d54cd27
commit
b4d7a7e8f6
@ -62,14 +62,9 @@ class SplFileInfo extends \SplFileInfo
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user