mirror of
https://github.com/php/php-src.git
synced 2025-01-03 17:33:32 +08:00
28 lines
518 B
PHP
28 lines
518 B
PHP
--TEST--
|
|
Bug #8009 (cannot add again same entry to an archive)
|
|
--SKIPIF--
|
|
<?php
|
|
/* $Id$ */
|
|
if(!extension_loaded('zip')) die('skip');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$thisdir = dirname(__FILE__);
|
|
$src = $thisdir . "/bug8009.zip";
|
|
$filename = $thisdir . "/tmp8009.zip";
|
|
copy($src, $filename);
|
|
|
|
$zip = new ZipArchive();
|
|
|
|
if (!$zip->open($filename)) {
|
|
exit("cannot open $filename\n");
|
|
}
|
|
$zip->addFromString("2.txt", "=)");
|
|
$zip->close();
|
|
unlink($filename);
|
|
echo "status: " . $zip->status . "\n";
|
|
echo "\n";
|
|
|
|
--EXPECT--
|
|
status: 0
|