Add destructor wich will try to clean up temp file of the template
processor
This commit is contained in:
parent
aca10785cf
commit
e9cd17d4c7
|
|
@ -132,6 +132,14 @@ class TemplateProcessor
|
|||
$this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
// if the temp file still exists, remove it when running destruct
|
||||
if ($this->tempDocumentFilename && file_exists($this->tempDocumentFilename) && is_writable($this->tempDocumentFilename)) {
|
||||
@unlink($this->tempDocumentFilename);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose zip class
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue