ID:               39231
 Updated by:       [EMAIL PROTECTED]
 Reported By:      lajbr at seznam dot cz
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: Windows 2003 Server
 PHP Version:      5.1.6
 Assigned To:      pajoye
 New Comment:

PHP 5.0.5 contains an old version of the zip extension. It was read
only and with some limitations in the amount of supported zip formats.

The new version is a complete rewrite, supports the creation,
modification and read of Zip files, adds a OO interface and many more
features.
Check the php manual for a full list of changes
(http://www.php.net/zip).


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

[2006-10-23 15:13:29] lajbr at seznam dot cz

Thank you for your help. We found a mistake in our side but this
behaviour of PHP is very strange. We have missing extension of the file
and PHP 5.0.5 probably automatically added correct extension to the
filename internally. PHP 5.2.0, 5.1.6 and 5.1.4  returns this Warning
in another zip functions. 
It's very interesting that according to the manual function zip_open()
have to return false when file doesn't exist or resource id. In the
fact (from PHP 5.1.4 and above) if file doesn't exist then function
zip_open()returns 11, returns 19 if it isn't Zip file and resource id
in other cases. This is strange behaviour because everybody expects
that zip_open() returns false when whichever error occures.

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

[2006-10-23 14:11:59] [EMAIL PROTECTED]

You are doing something wrong in your script.

I tried using 5.1.6, 5.2.0, 6.0 and with the latest pecl4win dll using
this script:
$zipfile = 'bug39231.zip';
if ($sourcezip = zip_open($zipfile)) {
    while ($zip_entry = zip_read($sourcezip)) {
        echo 'filename: '. zip_entry_name($zip_entry) . " ";
        echo 'filesize: '. zip_entry_filesize($zip_entry) . "\n";
    }
    zip_close($sourcezip);
} else {
    echo "Cannot open zip";
}


C:\php-5.1.6>php.exe bug39231.php
filename: result.htm filesize: 55457
filename: test.zip filesize: 131347
filename: ziptest.php filesize: 599

It works like a charm (and as expected). Be sure to load the correct
php_zip.dll or to have restarted your server after a dll update.

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

[2006-10-23 13:47:49] lajbr at seznam dot cz

Try to look at http://ambruz.webz.cz/problem.zip
Inside this zip are stored:
* ziptest.php ... script with phpinfo and tested function
* test.zip ... problem Zip file
* result.htm ... output with Warning messages and output of phpinfo.

I tried the latest files from pecl too but without effect.

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

[2006-10-23 12:49:53] [EMAIL PROTECTED]

I still need a Zip file to reproduce your problem.

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

[2006-10-23 12:46:12] lajbr at seznam dot cz

I tried to use the latest snapshot from mentioned link but with the
same result. In PHP 5.2-latest there is the same problem like in PHP
5.1.6 and 5.1.4.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/39231

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

Reply via email to