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

StreamedResponseListener::getSubscribedEvents()

static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: The method name to call (priority defaults to 0) An array composed of the method name to call and the priority An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: array('eventName' => 'methodName') array('eventName' => array('methodName', $priority)) a

StreamedResponse::sendContent()

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

StreamedResponse::setCallback()

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

StreamedResponse::getContent()

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

StreamedResponse::sendHeaders()

Response sendHeaders() Sends HTTP 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

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

StoreInterface::purge()

bool purge(string $url) Purges data for the given URL. Parameters string $url A URL Return Value bool true if the URL exists and has been purged, false otherwise

StoreInterface::lock()

bool|string lock(Request $request) Locks the cache for a given Request. Parameters Request $request A Request instance Return Value bool|string true if the lock is acquired, the path to the current lock otherwise