[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()
|
public function getContents()
|
||||||
{
|
{
|
||||||
$level = error_reporting(0);
|
$file = new \SplFileObject($this->getRealpath(), "rb");
|
||||||
$content = file_get_contents($this->getRealpath());
|
ob_start();
|
||||||
error_reporting($level);
|
$file->fpassthru();
|
||||||
if (false === $content) {
|
return ob_get_clean();
|
||||||
$error = error_get_last();
|
|
||||||
throw new \RuntimeException($error['message']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $content;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user