2 namespace TYPO3\CMS\Install\Service;
58 $bootstrap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance();
60 ->initializeCachingFramework()
61 ->initializePackageManagement(\TYPO3\CMS\Core\Package\PackageManager::class);
64 $database = $this->getDatabaseConnection();
65 $tables = $database->admin_get_tables();
66 foreach ($tables as $table) {
67 $tableName = $table[
'Name'];
68 if (substr($tableName, 0, 3) ===
'cf_') {
69 $database->exec_TRUNCATEquery($tableName);
70 }
elseif ($tableName ===
'cache_treelist') {
73 $database->exec_TRUNCATEquery(
'cache_treelist');
81 ->loadTypo3LoadedExtAndExtLocalconf(
false)
82 ->defineLoggingAndExceptionConstants()
83 ->unsetReservedGlobalVariables()
84 ->initializeTypo3DbGlobal()
85 ->loadExtensionTables(
false);
93 $cacheManager = new \TYPO3\CMS\Core\Cache\CacheManager();
94 $cacheManager->setCacheConfigurations(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'caching'][
'cacheConfigurations']);
96 new \TYPO3\CMS\Core\Cache\CacheFactory(
'production', $cacheManager);
98 $cacheManager->flushCaches();
107 protected function getDatabaseConnection()
110 if (!is_object($database)) {
112 $database = $this->objectManager->get(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
113 $database->setDatabaseUsername(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'username']);
114 $database->setDatabasePassword(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'password']);
115 $database->setDatabaseHost(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'host']);
116 $database->setDatabasePort(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'port']);
117 $database->setDatabaseSocket(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'socket']);
118 $database->setDatabaseName(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'database']);
119 $database->initialize();
120 $database->connectDB();