TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CacheHashCalculator Class Reference
Inheritance diagram for CacheHashCalculator:
SingletonInterface

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

 $cachedParametersWhiteList = array()
 
 $excludedParameters = array()
 
 $requireCacheHashPresenceParameters = array()
 
 $excludedParametersIfEmpty = array()
 
 $excludeAllEmptyParameters = false
 

Detailed Description

Logic for cHash calculation

Definition at line 22 of file CacheHashCalculator.php.

Constructor & Destructor Documentation

__construct ( )

Initialise class properties by using the relevant TYPO3 configuration

Definition at line 52 of file CacheHashCalculator.php.

References $GLOBALS, and CacheHashCalculator\setConfiguration().

Member Function Documentation

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 63 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\generateForParameters().

doParametersRequireCacheHash (   $queryString)

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

Parameters
string$queryString
Returns
bool

Definition at line 86 of file CacheHashCalculator.php.

References CacheHashCalculator\splitQueryStringToArray().

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 74 of file CacheHashCalculator.php.

References CacheHashCalculator\calculateCacheHash(), and CacheHashCalculator\getRelevantParameters().

getRelevantParameters (   $queryString)

Splits the input query-parameters into an array with certain parameters filtered out. Used to create the cHash value

Parameters
string$queryStringQuery-parameters: "&xxx=yyy&zzz=uuu
Returns
array Array with key/value pairs of query-parameters WITHOUT a certain list of
See Also
::makeCacheHash(), ::typoLink()

Definition at line 109 of file CacheHashCalculator.php.

References $GLOBALS, CacheHashCalculator\hasCachedParametersWhiteList(), CacheHashCalculator\isAdminPanelParameter(), CacheHashCalculator\isAllowedWithEmptyValue(), CacheHashCalculator\isCoreParameter(), CacheHashCalculator\isExcludedParameter(), CacheHashCalculator\isInCachedParametersWhiteList(), and CacheHashCalculator\splitQueryStringToArray().

Referenced by CacheHashCalculator\generateForParameters().

hasCachedParametersWhiteList ( )
protected

Checks whether cachedParametersWhiteList parameters are configured

Returns
bool

Definition at line 203 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\getRelevantParameters().

isAdminPanelParameter (   $key)
protected

Checks whether the given parameter starts with TSFE_ADMIN_PANEL stristr check added to avoid bad performance

Parameters
string$key
Returns
bool

Definition at line 160 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\getRelevantParameters().

isAllowedWithEmptyValue (   $key)
protected

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

Parameters
$key

Definition at line 213 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\getRelevantParameters().

isCoreParameter (   $key)
protected

Checks whether the given parameter is a core parameter

Parameters
string$key
Returns
bool

Definition at line 171 of file CacheHashCalculator.php.

References GeneralUtility\inList().

Referenced by CacheHashCalculator\getRelevantParameters().

isExcludedParameter (   $key)
protected

Checks whether the given parameter should be exluded from cHash calculation

Parameters
string$key
Returns
bool

Definition at line 182 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\getRelevantParameters().

isInCachedParametersWhiteList (   $key)
protected

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

Parameters
string$key
Returns
bool

Definition at line 193 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\getRelevantParameters().

setCachedParametersWhiteList ( array  $cachedParametersWhiteList)
protected
Parameters
array$cachedParametersWhiteList

Definition at line 237 of file CacheHashCalculator.php.

References CacheHashCalculator\$cachedParametersWhiteList.

setConfiguration (   $configuration)

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

Parameters
$configuration

Definition at line 224 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\__construct().

setExcludeAllEmptyParameters (   $excludeAllEmptyParameters)
protected
Parameters
bool$excludeAllEmptyParameters

Definition at line 245 of file CacheHashCalculator.php.

References CacheHashCalculator\$excludeAllEmptyParameters.

setExcludedParameters ( array  $excludedParameters)
protected
Parameters
array$excludedParameters

Definition at line 253 of file CacheHashCalculator.php.

References CacheHashCalculator\$excludedParameters.

setExcludedParametersIfEmpty ( array  $excludedParametersIfEmpty)
protected
Parameters
array$excludedParametersIfEmpty

Definition at line 261 of file CacheHashCalculator.php.

References CacheHashCalculator\$excludedParametersIfEmpty.

setRequireCacheHashPresenceParameters ( array  $requireCacheHashPresenceParameters)
protected
Parameters
array$requireCacheHashPresenceParameters

Definition at line 269 of file CacheHashCalculator.php.

References CacheHashCalculator\$requireCacheHashPresenceParameters.

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 142 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\doParametersRequireCacheHash(), and CacheHashCalculator\getRelevantParameters().

Member Data Documentation

$cachedParametersWhiteList = array()
protected
$excludeAllEmptyParameters = false
protected
$excludedParameters = array()
protected

Definition at line 32 of file CacheHashCalculator.php.

Referenced by CacheHashCalculator\setExcludedParameters().

$excludedParametersIfEmpty = array()
protected
$requireCacheHashPresenceParameters = array()
protected