|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-23 22:14 UTC] pajoye@php.net
[2007-05-24 07:30 UTC] sander dot marechal at tribal dot nl
[2007-05-24 09:07 UTC] pajoye@php.net
[2010-12-20 14:21 UTC] jani@php.net
-Package: Feature/Change Request
+Package: Zip Related
[2016-03-19 02:34 UTC] david dot proweb at gmail dot com
[2017-10-24 07:33 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: pajoye
+Assigned To:
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 21:00:02 2025 UTC |
Description: ------------ When I add or update a file in the zip archive, I cannot read the new file without closing and reopening the archive first. If this turns out to be a limitation in zlib then I suggest that a ZipArchive::flush() method of some sorts is added which can be called between a write and a read to produce the expected result. Reproduce code: --------------- #!/usr/bin/php -q <?php // Please make sure a dummy test.zip exist before running this code $zip = new ZipArchive(); $zip->open('test.zip'); $zip->addFromString('test.txt', 'some text'); echo "Before: " . $zip->getFromName('test.txt') . "\n"; $zip->close(); $zip->open('test.zip'); echo "After: " . $zip->getFromName('test.txt') . "\n"; ?> Expected result: ---------------- Both the 'before' and 'after' should output 'some text'. Actual result: -------------- 'before' is empty. Only 'after' shows 'some text'.