-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add ZipStreamWriter to stream-write zip archives on PHP 7.2+ #103
Conversation
PHP 8.2 and 8.3 fails on windows due to:
It seems like the zip extension is missing, cc @reimic. I may merge anyway some time soon and it will break Ci on trunk. |
Ports the [ZipStreamWriter](WordPress/blueprints-library#103) class from WordPress Blueprints PHP library to replace the zipstream-php library that only works with PHP 8.2. It probably works with PHP 7.2, too, but I haven't tested it there yet. cc @bgrgicak ## Testing instructions Attempt cloning the site in wp-admin (Tools > Sandbox site), confirm that it worked.
Sure. I know what this is about. Seems like an easy fix. Give me a sec. I'll take care of it now. |
I'd prepared a tiny fix, but I seem to have issues with pushing it to this branch directly. We'll figure it out sooner or later. In the meantime. Regarding the failing Windows runs. To
It's a bit funny, using a liberal definition of the word... To keep things clean - this also relates to #60 |
- Run PHPUnit tests pipeline with zip extension for all Windows versions. - No longer run the pipeline with php 7.0 and 7.1.
HA! Done. @adamziel |
Nice work! Couple of questions:
Observations
|
Hi.
|
Summary
This pull request introduces enhancements to the
ZipStreamWriter
class, enabling efficient file streaming and compression when writing ZIP archives. Key features include:Closes #88
Major Changes
writeFileFromPath
Method:deflate_add
.flush_directory_index
Method:Example Usage
How to Test
Notes
flush_directory_index
method should be called once all file entries have been written to ensure the ZIP archive is finalized correctly.Feel free to provide any feedback or request further modifications as needed.