mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Merge pull request #147 from parsecsv/file_get_contents
Replace fread with file_get_contents to avoid the 8192 byte limit
This commit is contained in:
12
src/Csv.php
12
src/Csv.php
@@ -1156,20 +1156,18 @@ class Csv {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read local file
|
||||
* Read local file.
|
||||
*
|
||||
* @param string|null $file local filename
|
||||
* @param string $file local filename
|
||||
*
|
||||
* @return string|false Data from file, or false on failure
|
||||
*/
|
||||
protected function _rfile($file = null) {
|
||||
protected function _rfile($file) {
|
||||
if (is_readable($file)) {
|
||||
if (!($fh = fopen($file, 'r'))) {
|
||||
$data = file_get_contents($file);
|
||||
if ($data === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = fread($fh, filesize($file));
|
||||
fclose($fh);
|
||||
return rtrim($data, "\r\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user