mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
mvc: FileObject write() should sync by default
This commit is contained in:
parent
44a38462fb
commit
d8b58d6417
@ -118,11 +118,15 @@ class FileObject
|
||||
* write contents to this file
|
||||
* @param string $data start position
|
||||
* @param int $length length to write
|
||||
* @param bool $sync flush data
|
||||
* @return this
|
||||
*/
|
||||
public function write(string $data, ?int $length = null)
|
||||
public function write(string $data, ?int $length = null, bool $sync = true)
|
||||
{
|
||||
fwrite($this->fhandle, $data, $length);
|
||||
if ($sync) {
|
||||
fflush($this->fhandle);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user