Skip to content

Instantly share code, notes, and snippets.

@kitzberger
Created April 16, 2026 09:57
Show Gist options
  • Select an option

  • Save kitzberger/985e7311c29dfdb524e0b63cf6620060 to your computer and use it in GitHub Desktop.

Select an option

Save kitzberger/985e7311c29dfdb524e0b63cf6620060 to your computer and use it in GitHub Desktop.
TYPO3 Cache Hook
<?php
declare(strict_types=1);
namespace Vendor\MyExtension\Hooks;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use TYPO3\CMS\Core\DataHandling\DataHandler;
class DataHandlerCacheFlushingHook implements LoggerAwareInterface
{
use LoggerAwareTrait;
public function doSomething(array $parameters, DataHandler $dataHandler)
{
unset($parameters['TSConfig']); // remove this key because it's only flooding the logs!
$this->logger->debug(print_r($parameters, true));
}
}
<?php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['my_extension'] = \Vendor\MyExtension\Hooks\DataHandlerCacheFlushingHook::class . '->doSomething';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment