Merge pull request #191 from box/close_file_pointer_when_done_writing

Writers did not close written file pointer
This commit is contained in:
Adrien Loison 2016-03-23 10:45:42 -07:00
commit e321f30c3b
2 changed files with 5 additions and 4 deletions

View File

@ -319,6 +319,11 @@ abstract class AbstractWriter implements WriterInterface
public function close()
{
$this->closeWriter();
if (is_resource($this->filePointer)) {
$this->globalFunctionsHelper->fclose($this->filePointer);
}
$this->isWriterOpened = false;
}
}

View File

@ -96,10 +96,6 @@ class Writer extends AbstractWriter
*/
protected function closeWriter()
{
if ($this->filePointer) {
$this->globalFunctionsHelper->fclose($this->filePointer);
}
$this->lastWrittenRowIndex = 0;
}
}