-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call of $this->zipClass->close() repeat twice #2548
Comments
What is the problem you are seeing? The close in the destructor is in a try-catch block, so I think it should just fail silently and harmlessly in your case; I don't see any error messages or any other problem when I run tests. |
Hmm, I think I do see a warning message when I run under Php7.4. That is long out of support, but I'll investigate further. |
This is very strange. I can reproduce the problem (for Php7) when running on its own. But I cannot reproduce it when running Phpunit tests with Php7, which is why this code passed all unit tests. I can fix it for Php7, but I can't formally prove that it's been fixed. |
Less of a mystery now. Php seems to have changed this from a warning to a fatal error in Php8. So Php8 has no warning message to suppress, and, without an at-sign, Php7 has no reason to suppress a message. |
Fix PHPOffice#2548. A particularly perplexing problem accidentally introduced by PR PHPOffice#2475. Problem does not arise for Php8, and does not arise for Php7 unit tests. But, running *not* under Phpunit auspices with Php7 can cause a warning message at destructor time if the `save` function has been used. A very artificial test is introduced to test this situation.
I'm having the same problem with php 7.3 |
Describe the Bug
Inside file TemplateProcessor.php in functions __destruct() and save() repeat code that close ZipArchive, and becouse of that error appears: ZipArchive::close() Invalid or unitialized Zip object
Steps to Reproduce
Please provide a code sample that reproduces the issue.
Expected Behavior
I think inside _destruct need to remove close() function
Context
Please fill in your environment information:
The text was updated successfully, but these errors were encountered: