From 2b7b4ddc5f537389e626e887ccecca8a759dc180 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Tue, 20 Sep 2022 11:05:16 +0200 Subject: [PATCH] Revert "Add destructor wich will try to clean up temp file of the template" This reverts commit e9cd17d4c7bc0ab4df09e858284369dbf7a98fff. Because the temp file is the result of the `save()` method and it's up to the calling code to handle the result appropriately. Or alternatively use `saveAs()` to avoid handling it. --- src/PhpWord/TemplateProcessor.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 2de104cf..1cf32429 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -131,14 +131,6 @@ 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. *