-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.5] Add stream download response #22764
Conversation
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.
No tests?
* Return a new streamed response as a file download from the application. | ||
* | ||
* @param \Closure $callback | ||
* @param string $name |
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.
string|null
according to your method signature
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.
Hi @mfn
Thanks for the PR review. I have pretty much copied the doc block from the "download" method. Would you also like me to make the same change to that doc block as well?
@mfn I couldn't find any tests for this class to add to. Do you know where a test for this method should go? |
|
Hi @sisve Thanks for the PR review. I was trying to copy the feel of the existing API of "file" and "download". Where file is just a basic wrapper around the Symfony class BinaryFileResponse and download goes one step further and sets up the content disposition. This PR was kind of born out of this stackoverflow question where it felt like people where searching for a similar function to download for remote files. Good point about the ResponseFactory contract. I have missed that and I will get this added to this PR tonight. |
@TheoKouzelis If you are going to modify a contract, then you should target |
@m1guelpf OK cool thanks. Should I remove this PR and make a new branch of 5.6? |
Yes, thanks! |
What is the discussion process behind adding a method to a contract? Because I'm looking at the ResponseFactory Contract in more detail and I can see "stream" and "download" are part of the interface but not "file". So it now makes me wonder if this method should be? |
This has now been moved to a PR on the 5.6 branch with @mfn doc block change and @sisve contract change added |
Adds the ability to respond with remote files as downloads.