PageArgumentValidator implements MiddlewareInterface, LoggerAwareInterface uses LoggerAwareTrait

This middleware validates given request parameters against the common "cHash" functionality.

Table of Contents

Interfaces

MiddlewareInterface
LoggerAwareInterface

Properties

$cacheHashCalculator  : CacheHashCalculator
The cHash Service class used for cHash related functionality
$disableCache  : bool
$timeTracker  : TimeTracker

Methods

__construct()  : mixed
process()  : ResponseInterface
Validates the &cHash parameter against the other $queryParameters / GET parameters
evaluateCacheHashParameter()  : bool
Calculates a hash string based on additional parameters in the url.
evaluatePageArgumentsWithoutCacheHash()  : bool
No cHash is set but there are query parameters, then calculate a possible cHash from the given query parameters and see if a cHash is returned (similar to comparing this).
evaluateQueryParametersWithoutCacheHash()  : bool
No cHash is set but there are query parameters, check if that is correct
getRelevantParametersForCacheHashCalculation()  : array<string, string>
Filters out the arguments that are necessary for calculating cHash

Properties

$disableCache

protected bool $disableCache = false

will be used to set $TSFE->no_cache later-on

Methods

process()

Validates the &cHash parameter against the other $queryParameters / GET parameters

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

evaluateCacheHashParameter()

Calculates a hash string based on additional parameters in the url.

protected evaluateCacheHashParameter(string $cHash, array<string, string> $relevantParameters, bool $pageNotFoundOnCacheHashError) : bool

This is used to cache pages with more parameters than just id and type.

Parameters
$cHash : string

the chash to check

$relevantParameters : array<string, string>

GET parameters necessary for cHash calculation

$pageNotFoundOnCacheHashError : bool

see $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']

Return values
bool

if false, then a PageNotFound response is triggered

evaluatePageArgumentsWithoutCacheHash()

No cHash is set but there are query parameters, then calculate a possible cHash from the given query parameters and see if a cHash is returned (similar to comparing this).

protected evaluatePageArgumentsWithoutCacheHash(PageArguments $pageArguments, bool $pageNotFoundOnCacheHashError) : bool

Is only called if NO cHash parameter is given.

Parameters
$pageArguments : PageArguments
$pageNotFoundOnCacheHashError : bool
Return values
bool

evaluateQueryParametersWithoutCacheHash()

No cHash is set but there are query parameters, check if that is correct

protected evaluateQueryParametersWithoutCacheHash(array<string, string|array<string|int, mixed>> $dynamicArguments, bool $pageNotFoundOnCacheHashError) : bool

Should only be called if NO cHash parameter is given.

Parameters
$dynamicArguments : array<string, string|array<string|int, mixed>>
$pageNotFoundOnCacheHashError : bool
Return values
bool

getRelevantParametersForCacheHashCalculation()

Filters out the arguments that are necessary for calculating cHash

protected getRelevantParametersForCacheHashCalculation(PageArguments $pageArguments) : array<string, string>
Parameters
$pageArguments : PageArguments
Return values
array<string, string>

        
On this page

Search results