ID: 50141
Updated by: [email protected]
Reported By: samantha86 at web dot de
-Status: Open
+Status: Feedback
Bug Type: Zip Related
Operating System: windows (xp and 7)
PHP Version: 5.3.0
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2009-11-10 19:26:28] samantha86 at web dot de
Description:
------------
hi,
i have a problem with files generated/altered via the ziparchive
class.
my problem is the same as Bug #39714, but i have been using php 5.3.0
instead of 5.2.x
i use to use ubuntu linux and i have NO problem there with extracting
the zip files. it does not matter on what server the zip files are
generated, windows or linux, it depends on the client where i try to
open one of these zip files.
the code for the zipfile generation looks like this:
Reproduce code:
---------------
<?php
class Zipper extends ZipArchive {
public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR."*");
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!="~") {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this->addDir($node,$newnode);
} else if (is_file($node)) {
$this->addFile($node,$newnode);
}
}
}
}
}
}
?>
Expected result:
----------------
i'd like to receive a zipfile where i can see the files, but also the
directories wit the included files that are generated in a deeper
recursion of the function
Actual result:
--------------
under windows i only see the files that are in the root of the zip
archive, under ubuntu linux everything is ok.
thank you in advance for sacrificing your time
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50141&edit=1