RedirectHandler implements MiddlewareInterface, LoggerAwareInterface uses LoggerAwareTrait

Hooks into the frontend request, and checks if a redirect should apply, If so, a redirect response is triggered.

Internal

Table of Contents

Interfaces

MiddlewareInterface
LoggerAwareInterface

Properties

$redirectService  : RedirectService

Methods

__construct()  : mixed
process()  : ResponseInterface
buildRedirectResponse()  : ResponseInterface
incrementHitCount()  : void
Updates the sys_redirect's hit counter by one
redirectUriWillRedirectToCurrentUri()  : bool
Checks if redirect uri matches current request uri.
sanitizeUriForComparison()  : UriInterface
Strip down uri to be suitable to make valid comparison in 'redirectUriWillRedirectToCurrentUri()' if uri is pointing to itself and redirect should be processed.

Properties

Methods

process()

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Return values
ResponseInterface

buildRedirectResponse()

protected buildRedirectResponse(UriInterface $uri, array<string|int, mixed> $redirectRecord) : ResponseInterface
Parameters
$uri : UriInterface
$redirectRecord : array<string|int, mixed>
Return values
ResponseInterface

incrementHitCount()

Updates the sys_redirect's hit counter by one

protected incrementHitCount(array<string|int, mixed> $redirectRecord) : void
Parameters
$redirectRecord : array<string|int, mixed>

redirectUriWillRedirectToCurrentUri()

Checks if redirect uri matches current request uri.

protected redirectUriWillRedirectToCurrentUri(ServerRequestInterface $request, UriInterface $redirectUri) : bool
Parameters
$request : ServerRequestInterface
$redirectUri : UriInterface
Return values
bool

sanitizeUriForComparison()

Strip down uri to be suitable to make valid comparison in 'redirectUriWillRedirectToCurrentUri()' if uri is pointing to itself and redirect should be processed.

protected sanitizeUriForComparison(UriInterface $uri, bool $relativeCheck) : UriInterface
Parameters
$uri : UriInterface
$relativeCheck : bool
Return values
UriInterface

        
On this page

Search results