PageContentErrorHandler implements PageErrorHandlerInterface
Renders the content of a page to be displayed (also in relation to language etc) This is typically configured via the "Sites configuration" module in the backend.
Table of Contents
Interfaces
- PageErrorHandlerInterface
- Page error handler interface, used to jump in for Frontend-related calls
Properties
- $application : Application
- $errorHandlerConfiguration : array<string|int, mixed>
- $guzzleClientFactory : GuzzleClientFactory
- $link : LinkService
- $pageUid : int
- $requestFactory : RequestFactoryInterface
- $responseFactory : ResponseFactoryInterface
- $siteFinder : SiteFinder
- $statusCode : int
Methods
- __construct() : mixed
- PageContentErrorHandler constructor.
- handlePageError() : ResponseInterface
- resolveUrl() : string
- Resolve the URL (currently only page and external URL are supported)
- sendExternalRequest() : ResponseInterface
- Sends an external request to fetch the error page from a remote resource.
- sendSubRequest() : ResponseInterface
- Sends an in-process subrequest.
- stashEnvironment() : ResponseInterface
- Stash and restore portions of the global environment around a subrequest callable.
Properties
$application
protected
Application
$application
$errorHandlerConfiguration
protected
array<string|int, mixed>
$errorHandlerConfiguration
$guzzleClientFactory
protected
GuzzleClientFactory
$guzzleClientFactory
$link
protected
LinkService
$link
$pageUid
protected
int
$pageUid
= 0
$requestFactory
protected
RequestFactoryInterface
$requestFactory
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
$siteFinder
protected
SiteFinder
$siteFinder
$statusCode
protected
int
$statusCode
Methods
__construct()
PageContentErrorHandler constructor.
public
__construct(int $statusCode, array<string|int, mixed> $configuration) : mixed
Parameters
- $statusCode : int
- $configuration : array<string|int, mixed>
Tags
handlePageError()
public
handlePageError(ServerRequestInterface $request, string $message[, array<string|int, mixed> $reasons = [] ]) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $message : string
- $reasons : array<string|int, mixed> = []
Return values
ResponseInterfaceresolveUrl()
Resolve the URL (currently only page and external URL are supported)
protected
resolveUrl(ServerRequestInterface $request, array<string|int, mixed> $urlParams) : string
Parameters
- $request : ServerRequestInterface
- $urlParams : array<string|int, mixed>
Return values
stringsendExternalRequest()
Sends an external request to fetch the error page from a remote resource.
protected
sendExternalRequest(string $url, ServerRequestInterface $originalRequest) : ResponseInterface
A custom header is added and checked to mitigate request loops, which indicates additional configuration error in the error handler config.
Parameters
- $url : string
- $originalRequest : ServerRequestInterface
Return values
ResponseInterfacesendSubRequest()
Sends an in-process subrequest.
protected
sendSubRequest(ServerRequestInterface $request, int $pageId, ServerRequestInterface $originalRequest) : ResponseInterface
The $pageId is used to ensure the correct site is accessed.
Parameters
- $request : ServerRequestInterface
- $pageId : int
- $originalRequest : ServerRequestInterface
Return values
ResponseInterfacestashEnvironment()
Stash and restore portions of the global environment around a subrequest callable.
protected
stashEnvironment(callable $fetcher) : ResponseInterface
Parameters
- $fetcher : callable