Unbuffered streaming output
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 12.3k
- Forks
- 2k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
Description
Hi, I am writing directly to php://output in my action because I do not want to buffer (large) output in memory or on disk. However, Slim quietly elects not to send headers in this case, because ResponseEmitter::emit notices headers_sent now returns true. How can I still send custom headers whilst writing output directly to PHP's output stream?
Note: Symfony supports this with StreamedResponse.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at ResponseEmitter::emit and inspect how headers_sent affects emission when the action writes directly to php://output. Compare the requested behavior with Symfony's StreamedResponse. Done means custom response headers can still be sent for unbuffered streaming output without buffering it in memory or on disk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100