StreamedResponseListener

class StreamedResponseListener implements EventSubscriberInterface StreamedResponseListener is responsible for sending the Response to the client. Methods onKernelResponse(FilterResponseEvent $event) Filters the Response. static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. Details onKernelResponse(FilterResponseEvent $event) Filters the Response. Parameters FilterResponseEvent $event A

StreamedResponse::setContent()

Response setContent(mixed $content) Sets the response content. Valid types are strings, numbers, null, and objects that implement a __toString() method. Parameters mixed $content Content that can be cast to string Return Value Response Exceptions UnexpectedValueException

StreamedResponse::setCallback()

setCallback(callable $callback) Sets the PHP callback associated with this Response. Parameters callable $callback A valid PHP callback

StreamedResponse::sendHeaders()

Response sendHeaders() Sends HTTP headers. Return Value Response

StreamedResponse::sendContent()

Response sendContent() Sends content for the current web response. Return Value Response

StreamedResponse::getContent()

string getContent() Gets the current response content. Return Value string Content

StreamedResponse::create()

static Response create(callable|null $callback = null, int $status = 200, array $headers = array()) Factory method for chainability. Parameters callable|null $callback A valid PHP callback or null to set it later int $status The response status code array $headers An array of response headers Return Value Response

StreamedResponse

class StreamedResponse extends Response StreamedResponse represents a streamed HTTP response. A StreamedResponse uses a callback for its content. The callback should use the standard PHP functions like echo to stream the response back to the client. The flush() method can also be used if needed. Constants HTTP_CONTINUE HTTP_SWITCHING_PROTOCOLS HTTP_PROCESSING HTTP_OK HTTP_CREATED HTTP_ACCEPTED HTTP_NON_AUTHORITATIVE_INFORMATION HTTP_NO_CONTENT HTTP_RESET_CONT

StoreInterface::write()

string write(Request $request, Response $response) Writes a cache entry to the store for the given Request and Response. Existing entries are read and any that match the response are removed. This method calls write with the new list of cache entries. Parameters Request $request A Request instance Response $response A Response instance Return Value string The key under which the response is stored

StoreInterface::unlock()

bool unlock(Request $request) Releases the lock for the given Request. Parameters Request $request A Request instance Return Value bool False if the lock file does not exist or cannot be unlocked, true otherwise