Req #54645 [Com]: zip:// stream wrapper does not allow wrapping of non-filesystem http:// streams

From: Date: Thu, 15 Apr 2021 19:36:44 +0000
Subject: Req #54645 [Com]: zip:// stream wrapper does not allow wrapping of non-filesystem http:// streams
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233445@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54645&edit=1

 ID:                 54645
 Comment by:         steveh at brendata dot co dot uk
 Reported by:        seva dot lapsha at gmail dot com
 Summary:            zip:// stream wrapper does not allow wrapping of
                     non-filesystem http:// streams
 Status:             Open
 Type:               Feature/Change Request
 Package:            Zip Related
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

I think this needs to be in the documentation, in the zlib wrapper as requiring that the wrapper be
seekable, and an extra row in documentation table for each wrapper to indicate whether it's
seekable or not?


Previous Comments:
------------------------------------------------------------------------
[2011-05-01 15:18:15] pajoye@php.net

ZipStream are something different but it is not supported anyway. Moving to FR.

------------------------------------------------------------------------
[2011-05-01 15:13:26] seva dot lapsha at gmail dot com

back-seeking may be needed for more complex operations in ZipArchive, but to read 
a stream directly from the Zip archive, it's not required.

For instance, there is a Java Zip Input Stream, which is buffered but not seeking.
http://download.oracle.com/javase/6/docs/api/java/util/zip/ZipInputStream.html

------------------------------------------------------------------------
[2011-05-01 14:24:47] pajoye@php.net

it does support non file system, but the file system must be seekable, which is 
not the case for http.

------------------------------------------------------------------------
[2011-05-01 14:15:51] seva dot lapsha at gmail dot com

Description:
------------
zip:// stream wrapper doesn't support streams created from sources other than 
files. E.g. reading from zip://http://example.com/file.zip
will fail with

Warning: 

As far as I can see, this is just not implemented in ZipArchive.

Test script:
---------------
$res = fopen('zip://http://example.com/file.zip');

Expected result:
----------------
Reading from zip wrapped URL should be possible.

Actual result:
--------------
Reading from zip wrapped URL gives warning:

fopen(zip://http://example.com/file.zip): failed to open
stream: operation failed


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



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


Thread (5 messages)

« previous php.bugs (#233445) next »