ISSUE-7: S3ObjectSeeker#10
Conversation
|
@digitaldogsbody will test now if copy stream is a good/performance option. I guess we could also pass directly back an open stream and let caller do the copy/consume/anything? Or we could have extra $mode argument in the signature to allow either the file to be passed back, the fully copied stream or the original open stream to be consumed. |
I think the problem with passing back the open stream is that for some Seekers the caller will then need to know the offset and length to retrieve (which is of course, technically possible from For S3Seeker it would be fine, as you are limiting the read bytes with the stream wrapper, but for LocalFileSeeker, the stream would just be to the whole zip file (hence the current use of a This is why I was thinking about the PartialReader utility class, because with that we could make the same behaviour in LocalFileSeeker as you would get from S3Seeker, and just be able to simplify The extra mode is a good idea, but maybe to keep the interface clean we could expose that as different functions on the interface (which of course in implementations would very simply call each other) and then deal with the logic in selecting which one to use in the ZipRangeReader library instead? |
@digitaldogsbody this works but lacks still
1.- Update on composer.json to require the
aws-sdkwhich we need (as sanity)2.- Tests
3.- Add the fetch file method
How I tested this (so far)?
testbucket and credentials minio/minio123 running localhost.Created a test Project with this composer.json (in this case this will go for PHP 8.1 which is actually good)
{ "name": "test/test", "repositories": [{ "type": "vcs", "url": "http://github.com/DiegoPino/mingulay" }], "require": { "digitaldogsbody/mingulay": "dev-ISSUE-7", "aws/aws-sdk-php": "^3.235" } }and with file at /src/test.php