TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Frontend\Page\CacheHashCalculator Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Page\CacheHashCalculator:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ()
 
 calculateCacheHash (array $params)
 
 generateForParameters ($queryString)
 
 doParametersRequireCacheHash ($queryString)
 
 getRelevantParameters ($queryString)
 
 setConfiguration (array $configuration)
 

Protected Member Functions

 splitQueryStringToArray ($queryString)
 
 isAdminPanelParameter ($key)
 
 isCoreParameter ($key)
 
 isExcludedParameter ($key)
 
 isInCachedParametersWhiteList ($key)
 
 hasCachedParametersWhiteList ()
 
 isAllowedWithEmptyValue ($key)
 
 setCachedParametersWhiteList (array $cachedParametersWhiteList)
 
 setIncludePageId ($includePageId)
 
 setExcludeAllEmptyParameters ($excludeAllEmptyParameters)
 
 setExcludedParameters (array $excludedParameters)
 
 setExcludedParametersIfEmpty (array $excludedParametersIfEmpty)
 
 setRequireCacheHashPresenceParameters (array $requireCacheHashPresenceParameters)
 

Protected Attributes

 $cachedParametersWhiteList = []
 
 $excludedParameters = []
 
 $requireCacheHashPresenceParameters = []
 
 $excludedParametersIfEmpty = []
 
 $excludeAllEmptyParameters = false
 
 $includePageId = false
 

Detailed Description

Logic for cHash calculation

Definition at line 20 of file CacheHashCalculator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::__construct ( )

Initialise class properties by using the relevant TYPO3 configuration

Definition at line 55 of file CacheHashCalculator.php.

References $GLOBALS, and TYPO3\CMS\Frontend\Page\CacheHashCalculator\setConfiguration().

Member Function Documentation

◆ calculateCacheHash()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::calculateCacheHash ( array  $params)

Calculates the cHash based on the provided parameters

Parameters
array$paramsArray of cHash key-value pairs
Returns
string Hash of all the values

Definition at line 66 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\generateForParameters().

◆ doParametersRequireCacheHash()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::doParametersRequireCacheHash (   $queryString)

Checks whether a parameter of the given $queryString requires cHash calculation

Parameters
string$queryString
Returns
bool

Definition at line 89 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\splitQueryStringToArray().

◆ generateForParameters()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::generateForParameters (   $queryString)

Returns the cHash based on provided query parameters and added values from internal call

Parameters
string$queryStringQuery-parameters: "&xxx=yyy&zzz=uuu
Returns
string Hash of all the values

Definition at line 77 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\calculateCacheHash(), and TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ getRelevantParameters()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::getRelevantParameters (   $queryString)

◆ hasCachedParametersWhiteList()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::hasCachedParametersWhiteList ( )
protected

Checks whether cachedParametersWhiteList parameters are configured

Returns
bool

Definition at line 218 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ isAdminPanelParameter()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::isAdminPanelParameter (   $key)
protected

Checks whether the given parameter is out of a known data-set starting with ADMCMD or starts with TSFE_ADMIN_PANEL.

Parameters
string$key
Returns
bool

Definition at line 173 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ isAllowedWithEmptyValue()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::isAllowedWithEmptyValue (   $key)
protected

Check whether the given parameter may be used even with an empty value

Parameters
$key
Returns
bool

Definition at line 229 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ isCoreParameter()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::isCoreParameter (   $key)
protected

Checks whether the given parameter is a core parameter

Parameters
string$key
Returns
bool

Definition at line 186 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ isExcludedParameter()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::isExcludedParameter (   $key)
protected

Checks whether the given parameter should be exluded from cHash calculation

Parameters
string$key
Returns
bool

Definition at line 197 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ isInCachedParametersWhiteList()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::isInCachedParametersWhiteList (   $key)
protected

Checks whether the given parameter is an exclusive parameter for cHash calculation

Parameters
string$key
Returns
bool

Definition at line 208 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

◆ setCachedParametersWhiteList()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setCachedParametersWhiteList ( array  $cachedParametersWhiteList)
protected
Parameters
array$cachedParametersWhiteList

Definition at line 253 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\$cachedParametersWhiteList.

◆ setConfiguration()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setConfiguration ( array  $configuration)

Loops through the configuration array and calls the accordant getters with the value.

Parameters
array$configuration

Definition at line 240 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\__construct().

◆ setExcludeAllEmptyParameters()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setExcludeAllEmptyParameters (   $excludeAllEmptyParameters)
protected
Parameters
bool$excludeAllEmptyParameters

Definition at line 269 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\$excludeAllEmptyParameters.

◆ setExcludedParameters()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setExcludedParameters ( array  $excludedParameters)
protected
Parameters
array$excludedParameters

Definition at line 277 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\$excludedParameters.

◆ setExcludedParametersIfEmpty()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setExcludedParametersIfEmpty ( array  $excludedParametersIfEmpty)
protected
Parameters
array$excludedParametersIfEmpty

Definition at line 285 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\$excludedParametersIfEmpty.

◆ setIncludePageId()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setIncludePageId (   $includePageId)
protected
Parameters
bool$includePageId

Definition at line 261 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\$includePageId.

◆ setRequireCacheHashPresenceParameters()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::setRequireCacheHashPresenceParameters ( array  $requireCacheHashPresenceParameters)
protected
Parameters
array$requireCacheHashPresenceParameters

Definition at line 293 of file CacheHashCalculator.php.

References TYPO3\CMS\Frontend\Page\CacheHashCalculator\$requireCacheHashPresenceParameters.

◆ splitQueryStringToArray()

TYPO3\CMS\Frontend\Page\CacheHashCalculator::splitQueryStringToArray (   $queryString)
protected

Parses the query string and converts it to an array. Unlike parse_str it only creates an array with one level.

e.g. foo[bar]=baz will be array('foo[bar]' => 'baz')

Parameters
$queryString
Returns
array

Definition at line 151 of file CacheHashCalculator.php.

Referenced by TYPO3\CMS\Frontend\Page\CacheHashCalculator\doParametersRequireCacheHash(), and TYPO3\CMS\Frontend\Page\CacheHashCalculator\getRelevantParameters().

Member Data Documentation

◆ $cachedParametersWhiteList

TYPO3\CMS\Frontend\Page\CacheHashCalculator::$cachedParametersWhiteList = []
protected

◆ $excludeAllEmptyParameters

TYPO3\CMS\Frontend\Page\CacheHashCalculator::$excludeAllEmptyParameters = false
protected

◆ $excludedParameters

TYPO3\CMS\Frontend\Page\CacheHashCalculator::$excludedParameters = []
protected

◆ $excludedParametersIfEmpty

TYPO3\CMS\Frontend\Page\CacheHashCalculator::$excludedParametersIfEmpty = []
protected

◆ $includePageId

TYPO3\CMS\Frontend\Page\CacheHashCalculator::$includePageId = false
protected

◆ $requireCacheHashPresenceParameters

TYPO3\CMS\Frontend\Page\CacheHashCalculator::$requireCacheHashPresenceParameters = []
protected