I basically need to be able to read ZIP streams from files hosted on an HTTP site. Currently, I can do streams with Guzzle, even if the file doesn't support seeking. You can just buffer the content in RAM, and then "seek" to it.
I understand the trade offs, but I need to read metadata from a file in a ZIP file that is very large, and I only need to open the first file in the archive, look at the first few lines to determine the contents, and then exit. Out of a 5 Gib file, I would probably only need to download the first few megabytes to accomplish this, the ZIP central directory, and then the beginning of the file in the archive, that I need to read the first few lines of.
Looking at your code, for example, reading the central directory, there is no reason why you can just "seek", not the PHP operation, but a "wrapper", for just downloading more bytes of the file, until you have enough to work with.
For zip files, If you need to grab data from a file that is later in the archive, then you are forced to download all of the data until you get to that entry.
Your package is perfect, because it works with SFTP, but I am unable to get it to work with HTTP.
I was thinking of just using Guzzle Wrappers and forking your code, but I Just don't have time and don't know your code well enough, to justify the time/cost investment.
Anyway, if you ever get around to support HTTP streams, or have a recommendation, I would look forward to that.
I basically need to be able to read ZIP streams from files hosted on an HTTP site. Currently, I can do streams with Guzzle, even if the file doesn't support seeking. You can just buffer the content in RAM, and then "seek" to it.
I understand the trade offs, but I need to read metadata from a file in a ZIP file that is very large, and I only need to open the first file in the archive, look at the first few lines to determine the contents, and then exit. Out of a 5 Gib file, I would probably only need to download the first few megabytes to accomplish this, the ZIP central directory, and then the beginning of the file in the archive, that I need to read the first few lines of.
Looking at your code, for example, reading the central directory, there is no reason why you can just "seek", not the PHP operation, but a "wrapper", for just downloading more bytes of the file, until you have enough to work with. For zip files, If you need to grab data from a file that is later in the archive, then you are forced to download all of the data until you get to that entry.
Your package is perfect, because it works with SFTP, but I am unable to get it to work with HTTP.
I was thinking of just using Guzzle Wrappers and forking your code, but I Just don't have time and don't know your code well enough, to justify the time/cost investment.
Anyway, if you ever get around to support HTTP streams, or have a recommendation, I would look forward to that.