ID:               47667
 Updated by:       mkoppa...@php.net
 Reported By:      mkoppa...@php.net
-Status:           Open
+Status:           Closed
 Bug Type:         Zip Related
 Operating System: Debian Linux
 PHP Version:      5.2.9
 Assigned To:      pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2009-03-15 21:55:01] mkoppa...@php.net

Description:
------------
ZipArchive::OVERWRITE flag has no effect. Even if the flag is passed to
ZipArchive::open method new files seem to be appended rather than
overwrite the existing files.

Reproduce code:
---------------
<?php

$File = 'test.zip';

$zip = new ZipArchive;
$res = $zip->open($File, ZipArchive::CREATE);

if($res === true)
   {
      $zip->addFromString('foo.txt', 'foo bar foobar');
      $zip->close();

      echo "ok\n";
   }

else
   {
      echo "failed errno: ". $res ."\n\n";
   }

unset($zip);


$zip = new ZipArchive;
$res = $zip->open($File, ZipArchive::OVERWRITE);

if($res === true)
   {
      $zip->addFromString('bar.txt', 'foo bar foobar');
      $zip->close();

      echo "ok\n";
   }

else
   {
      echo "failed errno: ". $res ."\n\n";
   }

unset($zip);

Expected result:
----------------
Zip file containing bar.txt

Actual result:
--------------
Zip file containing foo.txt and bar.txt


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47667&edit=1

Reply via email to