digitaldogsbody / mingulay

PHP Zip file parser
GNU Affero General Public License v3.0
1 stars 1 forks source link

Add ::getStream functionality #9

Closed digitaldogsbody closed 2 years ago

digitaldogsbody commented 2 years ago

The main functionality of this PR is to add ::getStream to the Seeker interface (+ an implementation for LocalFileSeeker), and a wrapper in ZipRangeReader, plus associated tests.

The interface method takes a length, an offset, and a boolean flag indicating whether or not DEFLATE compression is applied, and returns a file pointer.

The wrapper method in ZipRangeReader just takes a file path, and handles parsing the Local File Header (based on information from the Central Directory Record) and calculating the appropriate offset for the compressed data stream.

There are a couple of additional things covered as well:

Closes #1 Closes #11

digitaldogsbody commented 2 years ago

@DiegoPino I sent you an invite to join the repo so we can do reviews and you can manage properly any issues etc (hope that's ok - I know you already have many spinning plates!)

DiegoPino commented 2 years ago

This all looks good to me. Will wait for your decision on adding compression methods. But that can be a future enhancement?

digitaldogsbody commented 2 years ago

This all looks good to me. Will wait for your decision on adding compression methods. But that can be a future enhancement?

Yes, I think that is for the future. Good to get this into the codebase so we can implement/test various ::getStream methods and wrappers, as I think they will be a key part of the functionality for 1.0 release.