Skip to content
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

Implement readStream #8

Merged
merged 2 commits into from
May 26, 2015
Merged

Implement readStream #8

merged 2 commits into from
May 26, 2015

Conversation

sandisk
Copy link

@sandisk sandisk commented May 26, 2015

Even though phpseclib does support writing directly to a resource, StreamedReadingTrait polyfill was being used for readStream, which meant that entire file contents would be read into memory before being written to a stream. This would result in Allowed memory size of x bytes exhausted errors when attempting to download large files.

Tested this with a 1.7GB file and memory usage did not exceed 10MB.

@frankdejonge
Copy link
Member

@sandisk phpseclib didn't support this in the past, would you happen to know from which version on out they added this?

@sandisk
Copy link
Author

sandisk commented May 26, 2015

@frankdejonge It's supported since 0.3.8 (Sep 13, 2014)

frankdejonge added a commit that referenced this pull request May 26, 2015
@frankdejonge frankdejonge merged commit d71e5c2 into thephpleague:master May 26, 2015
@frankdejonge
Copy link
Member

I've removed the StreamedReading polyfill and tagged 1.0.5 which includes this patch.

@sandisk
Copy link
Author

sandisk commented May 26, 2015

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants