mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Addresses #62
This commit is contained in:
@@ -1147,9 +1147,17 @@ class parseCSV {
|
|||||||
*
|
*
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
protected function _wfile($file, $string = '') {
|
protected function _wfile($file, $string = '', $mode = 'wb', $lock = 2) {
|
||||||
file_put_contents($file, $string);
|
if ($fp = fopen($file, $mode)) {
|
||||||
|
flock($fp, $lock);
|
||||||
|
$re = fwrite($fp, $string);
|
||||||
|
$re2 = fclose($fp);
|
||||||
|
|
||||||
return true;
|
if ($re != false && $re2 != false) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user