-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISSUE-7: S3ObjectSeeker #10
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far :)
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-sdk
which we need (as sanity)2.- Tests
3.- Add the fetch file method
How I tested this (so far)?
test
bucket 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)
and with file at /src/test.php