View difference between Paste ID: K4jqBhKe and 2tyfLcBb
SHOW: | | - or go back to the newest paste.
1
// Deactivate TYPO3 caches in TYPO3 CMS v7/v8
2
// e.g. for Development Context
3
4-
// Automatic NullBackend for all caches (it's a caching backend which forgets everything immediately)
4+
// Automatic NullBackend for all caches if applicationContext is Development (it's a caching backend which forgets everything immediately)
5-
foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $cacheName => $cacheConfiguration) {
5+
6-
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['backend'] = \TYPO3\CMS\Core\Cache\Backend\NullBackend::class;
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
}