php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54645 zip:// stream wrapper does not allow wrapping of non-filesystem http:// streams
Submitted: 2011-05-01 14:15 UTC Modified: 2018-03-26 16:02 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: seva dot lapsha at gmail dot com Assigned:
Status: Open Package: Zip Related
PHP Version: 5.3.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
46 - 13 = ?
Subscribe to this entry?

 
 [2011-05-01 14:15 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-01 14:24 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-05-01 14:24 UTC] 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 15:13 UTC] 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 15:18 UTC] pajoye@php.net
-Status: Bogus +Status: Open
 [2011-05-01 15:18 UTC] pajoye@php.net
ZipStream are something different but it is not supported anyway. Moving to FR.
 [2018-03-26 16:02 UTC] cmb@php.net
-Type: Bug +Type: Feature/Change Request
 [2021-04-15 19:36 UTC] steveh at brendata dot co dot uk
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?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 17:01:30 2024 UTC