TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Frontend\Page\CacheHashCalculator Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Page\CacheHashCalculator:
TYPO3\CMS\Core\SingletonInterface t3lib_cacheHash

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)
 
 setIncludePageId ($includePageId)
 
 setExcludeAllEmptyParameters ($excludeAllEmptyParameters)
 
 setExcludedParameters (array $excludedParameters)
 
 setExcludedParametersIfEmpty (array $excludedParametersIfEmpty)
 
 setRequireCacheHashPresenceParameters (array $requireCacheHashPresenceParameters)
 

Protected Attributes

 $cachedParametersWhiteList = array()
 
 $excludedParameters = array()
 
 $requireCacheHashPresenceParameters = array()
 
 $excludedParametersIfEmpty = array()
 
 $excludeAllEmptyParameters = FALSE
 
 $includePageId = FALSE
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Logic for cHash calculation

Author
Daniel Pötzinger poetz.nosp@m.inge.nosp@m.r@aoe.nosp@m.medi.nosp@m.a.de Tolleiv Nietsch typo3.nosp@m.@tol.nosp@m.leiv..nosp@m.de

Definition at line 22 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 57 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 67 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
boolean

Definition at line 88 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
boolean

Definition at line 210 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
boolean

Definition at line 169 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

Definition at line 219 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
boolean

Definition at line 181 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
boolean

Definition at line 191 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
boolean

Definition at line 201 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 241 of file CacheHashCalculator.php.

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

◆ setConfiguration()

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

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

Parameters
$configuration

Definition at line 229 of file CacheHashCalculator.php.

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

◆ setExcludeAllEmptyParameters()

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

Definition at line 255 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 262 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 269 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 248 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 276 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 148 of file CacheHashCalculator.php.

References $parameters.

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 = array()
protected

◆ $excludeAllEmptyParameters

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

◆ $excludedParameters

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

◆ $excludedParametersIfEmpty

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

◆ $includePageId

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

◆ $requireCacheHashPresenceParameters

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