We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aca1078 commit e9cd17dCopy full SHA for e9cd17d
src/PhpWord/TemplateProcessor.php
@@ -132,6 +132,14 @@ public function __construct($documentTemplate)
132
$this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());
133
}
134
135
+ public function __destruct()
136
+ {
137
+ // if the temp file still exists, remove it when running destruct
138
+ if ($this->tempDocumentFilename && file_exists($this->tempDocumentFilename) && is_writable($this->tempDocumentFilename)) {
139
+ @unlink($this->tempDocumentFilename);
140
+ }
141
142
+
143
/**
144
* Expose zip class
145
*
0 commit comments