cookiePluginAction
extends wrapper
in package
Extending the wrapper class.
Table of Contents
- COOKIE_PREFIX = 'pc'
- A constant that is used to prefix the cookie name.
- $url_pattern : string|null
- A property that is used to filter the events.
- beforeRequest() : mixed
- Parsing the cookie header and extracting the cookies that are prefixed with `pc_`.
- headersReceived() : void
- Removing the `set-cookie` header from the response and adding a new one with the cookie name prefixed with `pc_`.
- onBeforeSend() : void
- A method that is called before the request is sent to the server.
- 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 execute code when the headers are received.
- 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
- Removing the `set-cookie` header from the response and adding a new one with the cookie name prefixed with `pc_`.
- onWrite() : void
- Used to execute code when the headers are received.
- Received() : void
- Parsing the cookie and then it is setting the cookie header.
- subscribe() : void
- Subscribing to all the events.
- parse_cookie() : array<string|int, mixed>
- Parsing the cookie and then it is returning an array with the cookie data.
- route() : void
- A method that is used to route the events to the appropriate methods.
Constants
COOKIE_PREFIX
A constant that is used to prefix the cookie name.
public
mixed
COOKIE_PREFIX
= 'pc'
Properties
$url_pattern
A property that is used to filter the events.
protected
string|null
$url_pattern
= null
Methods
beforeRequest()
Parsing the cookie header and extracting the cookies that are prefixed with `pc_`.
public
static beforeRequest(mixed $match) : mixed
Parameters
- $match : mixed
Return values
mixed —headersReceived()
Removing the `set-cookie` header from the response and adding a new one with the cookie name prefixed with `pc_`.
public
static headersReceived(mixed $response, mixed $set_cookie) : void
Parameters
- $response : mixed
- $set_cookie : mixed
Return values
void —onBeforeSend()
A method that is called before the request is sent to the server.
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 execute code when the headers are received.
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()
Removing the `set-cookie` header from the response and adding a new one with the cookie name prefixed with `pc_`.
public
onSent() : void
Return values
void —onWrite()
Used to execute code when the headers are received.
public
onWrite() : void
Return values
void —Received()
Parsing the cookie and then it is setting the cookie header.
public
static Received(mixed $line) : void
Parameters
- $line : mixed
Return values
void —subscribe()
Subscribing to all the events.
public
final subscribe(yP $dispatcher) : void
Parameters
- $dispatcher : yP
Return values
void —parse_cookie()
Parsing the cookie and then it is returning an array with the cookie data.
private
static parse_cookie(mixed $line, mixed $url) : array<string|int, mixed>
Parameters
- $line : mixed
- $url : mixed
Return values
array<string|int, mixed> —route()
A method that is used to route the events to the appropriate methods.
private
route(string $event_name) : void
Parameters
- $event_name : string