Ticket #408 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Allow streams as response content

Reported by: david Owned by: david
Priority: normal Milestone: 0.11
Component: response Version:
Severity: normal Keywords:
Cc: Patch attached:

Description

$res->setContent(fopen('/my/image/file'));

will then be fpassthru()'d in Response::sendContent() - just have to pay attention to caching, where responses are serialized, so __sleep() has to store stream_get_meta_data() info, and __wakeup() must restore that.

Attachments

Change History

Changed 2 years ago by david

  • status changed from new to closed
  • resolution set to fixed

(In [1636]) a response now accepts a stream as content which will be fpassthru()'d when the response is sent, good for serving images, pdf files etc. can be cached, too, the stream meta data is used to restore the info then. closes #408

Changed 2 years ago by david

(In [1645]) send Content-Type automatically if it can be determined (and unless it is set already, of course). also refs #408

Add/Change #408 (Allow streams as response content)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.