streamPluginAction
extends wrapper
in package
Extending the wrapper class, which is a class that allows you to listen to events.
Table of Contents
- $url_pattern : string|null
- A property that is used to filter the events.
- $max_content_length : int
- Used to determine if the response should be streamed or not.
- $output_buffer_types : array<string|int, mixed>
- An array of content types that will be streamed.
- $stream : bool
- A variable that is used to determine if the response should be streamed or not.
- onBeforeSend() : void
- Used to build the result.
- onCache() : void
- A method that is called when the event `EVENT_BUILD_CACHE` is triggered.
- onCheck() : self
- Used to check if the event should be executed.
- onComplete() : void
- Used to exit the script when the response is streamed.
- onContext() : void
- A method that is called when the event `EVENT_BUILD_CONTEXT` is triggered.
- onException() : void
- Used to execute code when an exception is thrown.
- onFinal() : void
- Used to execute code when the request is completed.
- onHeaders() : void
- A method that is called when the event `EVENT_BUILD_HEADERS` is triggered.
- onIncludes() : void
- A method that is called when the event `EVENT_BUILD_INCLUDES` is triggered.
- onRequest() : void
- A method that is called when the event `EVENT_BUILD_REQUEST` is triggered.
- onSend() : void
- Used to execute code when the request is sent.
- onSent() : void
- Checking if the content type is in the array of content types that should be streamed. If it is, it sets the `$stream` variable to true.
- onWrite() : void
- A function that is called when the proxy receives data from the server.
- subscribe() : void
- Subscribing to all the events.
- route() : void
- A method that is used to route the events to the appropriate methods.
Properties
$url_pattern
A property that is used to filter the events.
protected
string|null
$url_pattern
= null
$max_content_length
Used to determine if the response should be streamed or not.
private
int
$max_content_length
= 5000000
$output_buffer_types
An array of content types that will be streamed.
private
array<string|int, mixed>
$output_buffer_types
= array(VAR_TEXT_HTML, 'text/plain', 'text/css', 'text/javascript', 'application/x-javascript', 'application/javascript')
$stream
A variable that is used to determine if the response should be streamed or not.
private
bool
$stream
= false
Methods
onBeforeSend()
Used to build the result.
public
onBeforeSend() : void
Return values
void —onCache()
A method that is called when the event `EVENT_BUILD_CACHE` is triggered.
public
onCache() : void
Return values
void —onCheck()
Used to check if the event should be executed.
public
onCheck() : self
Return values
self —onComplete()
Used to exit the script when the response is streamed.
public
onComplete() : void
Return values
void —onContext()
A method that is called when the event `EVENT_BUILD_CONTEXT` is triggered.
public
onContext() : void
Return values
void —onException()
Used to execute code when an exception is thrown.
public
onException(Exception $e) : void
Parameters
- $e : Exception
Return values
void —onFinal()
Used to execute code when the request is completed.
public
onFinal() : void
Return values
void —onHeaders()
A method that is called when the event `EVENT_BUILD_HEADERS` is triggered.
public
onHeaders() : void
Return values
void —onIncludes()
A method that is called when the event `EVENT_BUILD_INCLUDES` is triggered.
public
onIncludes() : void
Return values
void —onRequest()
A method that is called when the event `EVENT_BUILD_REQUEST` is triggered.
public
onRequest() : void
Return values
void —onSend()
Used to execute code when the request is sent.
public
onSend() : void
Return values
void —onSent()
Checking if the content type is in the array of content types that should be streamed. If it is, it sets the `$stream` variable to true.
public
onSent() : void
Return values
void —onWrite()
A function that is called when the proxy receives data from the server.
public
onWrite() : void
Return values
void —subscribe()
Subscribing to all the events.
public
final subscribe(yP $dispatcher) : void
Parameters
- $dispatcher : yP
Return values
void —route()
A method that is used to route the events to the appropriate methods.
private
route(string $event_name) : void
Parameters
- $event_name : string