jousch

Clear TYPO3 caches Development, AdditionalConfiguration.php

Oct 6th, 2016
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Deactivate TYPO3 caches in TYPO3 CMS v7/v8
  2. // e.g. for Development Context
  3.  
  4. // Automatic NullBackend for all caches if applicationContext is Development (it's a caching backend which forgets everything immediately)
  5.  
  6. if(\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->isDevelopment()) {
  7.     foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $cacheName => $cacheConfiguration) {
  8.         $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['backend'] = \TYPO3\CMS\Core\Cache\Backend\NullBackend::class;
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment