getConnectionByName('Default'); $tableNames = $connection->getSchemaManager()->listTableNames(); foreach ($tableNames as $tableName) { if (strpos($tableName, 'cf_') === 0 || $tableName === 'cache_treelist') { $connection->truncate($tableName); } } // check tables on other connections $remappedTables = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']) ? array_keys((array)$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']) : []; foreach ($remappedTables as $tableName) { if (strpos((string)$tableName, 'cf_') === 0 || $tableName === 'cache_treelist') { $connectionPool->getConnectionForTable($tableName)->truncate($tableName); } } // From this point on, the code may fatal, if some broken extension is loaded. // Use bootstrap to load all ext_localconf and ext_tables Bootstrap::loadTypo3LoadedExtAndExtLocalconf(false); Bootstrap::unsetReservedGlobalVariables(); Bootstrap::loadBaseTca(false); Bootstrap::loadExtTables(false); // The cache manager is already instantiated in the install tool // with some hacked settings to disable caching of extbase and fluid. // We want a "fresh" object here to operate on a different cache setup. // cacheManager implements SingletonInterface, so the only way to get a "fresh" // instance is by circumventing makeInstance and/or the objectManager and // using new directly! $cacheManager = new \TYPO3\CMS\Core\Cache\CacheManager(); $cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']); $cacheManager->flushCaches(); } }