Fix output file deletion after exception thrown on write (#328)

For relative paths, it would not work as the FileSystemHelper would not allow deleting a file that's not part of its base folder.
This commit is contained in:
Adrien Loison authored and GitHub committed 2016-10-12 11:15:07 -07:00
1 parent 23f8cc4f05
commit 77178122c3
5 files changed
+10 -21

No files matched your search

+2 -2
View File
@@ -372,8 +372,8 @@ abstract class AbstractWriter implements WriterInterface
// remove output file if it was created
if ($this->globalFunctionsHelper->file_exists($this->outputFilePath)) {
$outputFolder = $this->globalFunctionsHelper->dirname($this->outputFilePath);
$fileSystemHelper = new FileSystemHelper($outputFolder);
$outputFolderPath = dirname($this->outputFilePath);
$fileSystemHelper = new FileSystemHelper($outputFolderPath);
$fileSystemHelper->deleteFile($this->outputFilePath);
}
}