We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fopen
fread
file_get_contents
Scanner
1 parent 3c45a8c commit d54de21Copy full SHA for d54de21
1 file changed
src/Scanner/Scanner.php
@@ -77,15 +77,12 @@ protected function saveTranslation(
77
*/
78
protected static function readFile(string $file): string
79
{
80
- $length = filesize($file);
+ $content = @file_get_contents($file);
81
82
- if (!($fd = fopen($file, 'rb'))) {
+ if (false === $content) {
83
throw new Exception("Cannot read the file '$file', probably permissions");
84
}
85
-
86
- $content = $length ? fread($fd, $length) : '';
87
- fclose($fd);
88
+
89
return $content;
90
91
0 commit comments