Skip to content

Instantly share code, notes, and snippets.

View bjrnqprs's full-sized avatar

Björn Kuipers bjrnqprs

View GitHub Profile
@bjrnqprs
bjrnqprs / gist:5487083
Last active September 7, 2018 11:25
Typo3 6.0 - Generate a cHash (Note: differs from cache identifier in Extbase caching framework)
<?php
/* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */
$cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
$result = $cacheHash->generateForParameters($_SERVER['QUERY_STRING']);
<?php
/**
* Clears the cache based on the command $cacheCmd.
*
* $cacheCmd='pages': Clears cache for all pages. Requires admin-flag to
* be set for BE_USER.
*
* $cacheCmd='all': Clears all cache_tables. This is necessary if
* templates are updated. Requires admin-flag to be set for BE_USER.
*