#39231 [Fbk]: Problem with reading of .ZIP file content
| From: | pajoye@php.net | Date: | Mon, 23 Oct 2006 12:39:09 +0000 |
| Subject: | #39231 [Fbk]: Problem with reading of .ZIP file content | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103904@lists.php.net to get a copy of this message | ||
ID: 39231
Updated by: pajoye@php.net
Reported By: lajbr at seznam dot cz
Status: Feedback
Bug Type: Unknown/Other Function
Operating System: Windows 2003 Server
PHP Version: 5.1.6
-Assigned To:
+Assigned To: pajoye
New Comment:
Also which Zip extension do you use? (See phpinfo, $id and version).
If the problem persists with 5.2.0 or a recent version (get the latest
DLLs on http://pecl4win.php.net), please provide a link to the
zip file
you use in this test.
Previous Comments:
------------------------------------------------------------------------
[2006-10-23 09:21:01] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-10-23 09:13:24] lajbr at seznam dot cz
Description:
------------
I found a serious problem on PHP 5.1.6 (5.1.4 too). I try to read
content of .ZIP file (part of code is added below). I open an existing
ZIP file and I want to read its content. But Warning message with
following text is appeared (text is added below). The same problem
occured when I use function zip_close(). As the result nothing is
happened (no content from ZIP file is readed). When I go back to PHP
version 5.0.5 then all works fine.
Reproduce code:
---------------
function ziplist($zipfile){
$retval = array();
if ($sourcezip = @zip_open($zipfile)) {
while ($zip_entry = zip_read($sourcezip)) {
array_push($retval,array('filename' =>
zip_entry_name($zip_entry),
'filesize' =>
zip_entry_filesize($zip_entry)));
}
zip_close($sourcezip);
} else return false;
return $retval;
}
Expected result:
----------------
Warning: zip_read() expects parameter 1 to be resource, integer given
in C:\Inetpub\wwwroot\epo\include\function.php on line 439
Warning: zip_close() expects parameter 1 to be resource, integer given
in C:\Inetpub\wwwroot\epo\include\function.php on line 443
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39231&edit=1