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.
2 parents 969448f + e9cd17d commit 62444d2Copy full SHA for 62444d2
src/PhpWord/TemplateProcessor.php
@@ -131,6 +131,14 @@ public function __construct($documentTemplate)
131
$this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());
132
}
133
134
+ public function __destruct()
135
+ {
136
+ // if the temp file still exists, remove it when running destruct
137
+ if ($this->tempDocumentFilename && file_exists($this->tempDocumentFilename) && is_writable($this->tempDocumentFilename)) {
138
+ @unlink($this->tempDocumentFilename);
139
+ }
140
141
+
142
/**
143
* Expose zip class.
144
*
0 commit comments