2 declare(strict_types = 1);
18 use Doctrine\DBAL\DBALException;
19 use Doctrine\DBAL\DriverManager;
20 use Psr\Http\Message\ResponseInterface;
21 use Psr\Http\Message\ServerRequestInterface;
22 use TYPO3\CMS\Core\Configuration\ConfigurationManager;
45 use TYPO3\CMS\Core\Package\PackageManager;
77 'Cache-Control' =>
'no-cache, must-revalidate',
78 'Pragma' =>
'no-cache'
93 'html' => $view->render(),
107 'html' => $view->render(),
119 'success' => @is_file(GeneralUtility::makeInstance(ConfigurationManager::class)->getLocalConfigurationFileLocation()),
132 $checkMessages = (
new Check())->getStatus();
133 foreach ($checkMessages as $message) {
134 $systemCheckMessageQueue->enqueue($message);
136 $setupCheckMessages = (
new SetupCheck())->getStatus();
137 foreach ($setupCheckMessages as $message) {
138 $systemCheckMessageQueue->enqueue($message);
140 $folderStructureFactory = GeneralUtility::makeInstance(DefaultFactory::class);
141 $structureFacade = $folderStructureFactory->getStructure();
142 $structureMessageQueue = $structureFacade->getStatus();
145 'html' => $view->render(),
159 $folderStructureFactory = GeneralUtility::makeInstance(DefaultFactory::class);
160 $structureFacade = $folderStructureFactory->getStructure();
161 $structureFixMessageQueue = $structureFacade->fix();
165 $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
166 $configurationManager->createLocalConfigurationFromFactoryConfiguration();
170 $packageManager = GeneralUtility::makeInstance(PackageManager::class);
171 $packages = $packageManager->getAvailablePackages();
172 foreach ($packages as $package) {
176 $packageManager->activatePackage($package->getPackageKey());
179 $packageManager->forceSortAndSavePackageStates();
182 $extensionConfiguration->synchronizeExtConfTemplateWithLocalConfigurationOfAllExtensions();
190 'status' => $errorsFromStructure,
202 'success' => GeneralUtility::hostHeaderValueMatchesTrustedHostsPattern($_SERVER[
'HTTP_HOST']),
213 if (!GeneralUtility::hostHeaderValueMatchesTrustedHostsPattern($_SERVER[
'HTTP_HOST'])) {
214 $configurationManager =
new ConfigurationManager();
215 $configurationManager->setLocalConfigurationValueByPath(
'SYS/trustedHostsPattern',
'.*');
232 $silentUpdate->execute();
237 'success' => $success,
262 $hasAtLeastOneOption =
false;
263 $activeAvailableOption =
'';
264 if (extension_loaded(
'mysqli')) {
265 $hasAtLeastOneOption =
true;
266 $view->assign(
'hasMysqliManualConfiguration',
true);
267 $mysqliManualConfigurationOptions = [
268 'username' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'user'] ??
'',
269 'password' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'password'] ??
'',
270 'port' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'port'] ?? 3306,
272 $host =
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'host'] ??
'127.0.0.1';
273 if ($host ===
'localhost') {
276 $mysqliManualConfigurationOptions[
'host'] = $host;
277 $view->assign(
'mysqliManualConfigurationOptions', $mysqliManualConfigurationOptions);
278 $activeAvailableOption =
'mysqliManualConfiguration';
280 $view->assign(
'hasMysqliSocketManualConfiguration',
true);
282 'mysqliSocketManualConfigurationOptions',
284 'username' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'user'] ??
'',
285 'password' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'password'] ??
'',
289 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'driver'] ===
'mysqli'
290 &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'host'] ===
'localhost') {
291 $activeAvailableOption =
'mysqliSocketManualConfiguration';
294 if (extension_loaded(
'pdo_pgsql')) {
295 $hasAtLeastOneOption =
true;
296 $view->assign(
'hasPostgresManualConfiguration',
true);
298 'postgresManualConfigurationOptions',
300 'username' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'user'] ??
'',
301 'password' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'password'] ??
'',
302 'host' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'host'] ??
'127.0.0.1',
303 'port' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'port'] ?? 5432,
304 'database' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'dbname'] ??
'',
307 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'driver'] ===
'pdo_pgsql') {
308 $activeAvailableOption =
'postgresManualConfiguration';
311 if (extension_loaded(
'pdo_sqlite')) {
312 $hasAtLeastOneOption =
true;
313 $view->assign(
'hasSqliteManualConfiguration',
true);
315 'sqliteManualConfigurationOptions',
318 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'driver'] ===
'pdo_sqlite') {
319 $activeAvailableOption =
'sqliteManualConfiguration';
324 $hasAtLeastOneOption =
true;
325 $activeAvailableOption =
'configurationFromEnvironment';
326 $view->assign(
'hasConfigurationFromEnvironment',
true);
329 $view->assignMultiple([
330 'hasAtLeastOneOption' => $hasAtLeastOneOption,
331 'activeAvailableOption' => $activeAvailableOption,
332 'executeDatabaseConnectToken' => $formProtection->generateToken(
'installTool',
'executeDatabaseConnect'),
337 'html' => $view->render(),
350 $postValues = $request->getParsedBody()[
'install'][
'values'];
351 $defaultConnectionSettings = [];
353 if ($postValues[
'availableSet'] ===
'configurationFromEnvironment') {
356 if (isset($postValues[
'driver'])) {
364 if (in_array($postValues[
'driver'], $validDrivers,
true)) {
365 $defaultConnectionSettings[
'driver'] = $postValues[
'driver'];
368 'Given driver must be one of ' . implode(
', ', $validDrivers),
369 'Database driver unknown',
374 if (isset($postValues[
'username'])) {
375 $value = $postValues[
'username'];
376 if (strlen($value) <= 50) {
377 $defaultConnectionSettings[
'user'] = $value;
380 'Given username must be shorter than fifty characters.',
381 'Database username not valid',
386 if (isset($postValues[
'password'])) {
387 $defaultConnectionSettings[
'password'] = $postValues[
'password'];
389 if (isset($postValues[
'host'])) {
390 $value = $postValues[
'host'];
391 if (preg_match(
'/^[a-zA-Z0-9_\\.-]+(:.+)?$/', $value) && strlen($value) <= 255) {
392 $defaultConnectionSettings[
'host'] = $value;
395 'Given host is not alphanumeric (a-z, A-Z, 0-9 or _-.:) or longer than 255 characters.',
396 'Database host not valid',
401 if (isset($postValues[
'port']) && $postValues[
'host'] !==
'localhost') {
402 $value = $postValues[
'port'];
403 if (preg_match(
'/^[0-9]+(:.+)?$/', $value) && $value > 0 && $value <= 65535) {
404 $defaultConnectionSettings[
'port'] = (int)$value;
407 'Given port is not numeric or within range 1 to 65535.',
408 'Database port not valid',
413 if (isset($postValues[
'socket']) && $postValues[
'socket'] !==
'') {
414 if (@file_exists($postValues[
'socket'])) {
415 $defaultConnectionSettings[
'unix_socket'] = $postValues[
'socket'];
418 'Given socket location does not exist on server.',
419 'Socket does not exist',
424 if (isset($postValues[
'database'])) {
425 $value = $postValues[
'database'];
426 if (strlen($value) <= 50) {
427 $defaultConnectionSettings[
'dbname'] = $value;
430 'Given database name must be shorter than fifty characters.',
431 'Database name not valid',
437 if (isset($postValues[
'driver']) && $postValues[
'driver'] ===
'pdo_sqlite') {
438 $dbFilename =
'/cms-' . (
new Random())->generateRandomHexString(8) .
'.sqlite';
449 if (isset($postValues[
'driver']) && in_array($postValues[
'driver'], [
'mysqli',
'pdo_mysql'])) {
450 $defaultConnectionSettings[
'charset'] =
'utf8mb4';
451 $defaultConnectionSettings[
'tableoptions'] = [
452 'charset' =>
'utf8mb4',
453 'collate' =>
'utf8mb4_unicode_ci',
459 if (!empty($defaultConnectionSettings)) {
462 $connectionParams = $defaultConnectionSettings;
463 $connectionParams[
'wrapperClass'] = Connection::class;
464 if (!isset($connectionParams[
'charset'])) {
466 $connectionParams[
'charset'] =
'utf-8';
468 DriverManager::getConnection($connectionParams)->ping();
470 }
catch (DBALException $e) {
472 'Connecting to the database with given settings failed: ' . $e->getMessage(),
473 'Database connect not successful',
477 $localConfigurationPathValuePairs = [];
478 foreach ($defaultConnectionSettings as $settingsName => $value) {
479 $localConfigurationPathValuePairs[
'DB/Connections/Default/' . $settingsName] = $value;
481 $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
483 $configurationManager->removeLocalConfigurationKeysByPath([
'DB/Connections/Default']);
485 $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
489 'success' => $success,
490 'status' => $messages,
502 if ((
string)
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'dbname'] !==
''
503 || (
string)
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'path'] !==
''
506 $success = GeneralUtility::makeInstance(ConnectionPool::class)
509 }
catch (DBALException $e) {
513 'success' => $success,
530 $errors[] = $exception->getMessage();
532 $view->assignMultiple([
534 'executeDatabaseSelectToken' => $formProtection->generateToken(
'installTool',
'executeDatabaseSelect'),
538 'html' => $view->render(),
550 $postValues = $request->getParsedBody()[
'install'][
'values'];
551 if ($postValues[
'type'] ===
'new') {
556 'status' => [$status],
559 } elseif ($postValues[
'type'] ===
'existing' && !empty($postValues[
'existing'])) {
564 'status' => [$status],
572 'You must select a database.',
573 'No Database selected',
591 $existingTables = GeneralUtility::makeInstance(ConnectionPool::class)
592 ->getConnectionByName(
'Default')
596 'success' => !empty($existingTables),
609 $view->assignMultiple([
610 'siteName' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'],
611 'executeDatabaseDataToken' => $formProtection->generateToken(
'installTool',
'executeDatabaseData'),
615 'html' => $view->render(),
628 $configurationManager =
new ConfigurationManager();
629 $postValues = $request->getParsedBody()[
'install'][
'values'];
630 $username = (string)$postValues[
'username'] !==
'' ? $postValues[
'username'] :
'admin';
632 $password = $postValues[
'password'];
633 if (empty($password) || strlen($password) < 8) {
635 'You are setting an important password here! It gives an attacker full control over your instance if cracked.'
636 .
' It should be strong (include lower and upper case characters, special characters and numbers) and must be at least eight characters long.',
637 'Administrator password not secure enough!',
642 'status' => $messages,
646 if (!empty($postValues[
'sitename'])) {
647 $configurationManager->setLocalConfigurationValueByPath(
'SYS/sitename', $postValues[
'sitename']);
651 if (!empty($messages)) {
654 'status' => $messages,
659 'Error detected in SQL statement:' . LF . $exception->getMessage(),
660 'Import of database data could not be performed',
665 'status' => $messages,
670 'username' => $username,
676 $databaseConnection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable(
'be_users');
678 $databaseConnection->insert(
'be_users', $adminUserFields);
679 $adminUserUid = (int)$databaseConnection->lastInsertId(
'be_users');
680 }
catch (DBALException $exception) {
682 'The administrator account could not be created. The following error occurred:' . LF
683 . $exception->getPrevious()->getMessage(),
684 'Administrator account not created!',
689 'status' => $messages,
693 $configurationManager->setLocalConfigurationValuesByPathValuePairs([
695 'SYS/systemMaintainers' => [$adminUserUid]
699 'status' => $messages,
712 $view->assignMultiple([
714 'executeDefaultConfigurationToken' => $formProtection->generateToken(
'installTool',
'executeDefaultConfiguration'),
718 'html' => $view->render(),
732 $configurationValues = $featureManager->getBestMatchingConfigurationForAllFeatures();
733 $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
736 switch ($request->getParsedBody()[
'install'][
'values'][
'sitesetup']) {
738 case 'loaddistribution':
739 $adminUserFirstLogin = [
740 'startModuleOnFirstLogin' =>
'tools_ExtensionmanagerExtensionmanager->tx_extensionmanager_tools_extensionmanagerextensionmanager%5Baction%5D=distributions&tx_extensionmanager_tools_extensionmanagerextensionmanager%5Bcontroller%5D=List',
741 'ucSetByInstallTool' =>
'1',
743 $connectionPool->getConnectionForTable(
'be_users')->update(
745 [
'uc' => serialize($adminUserFirstLogin)],
752 $databaseConnectionForPages = $connectionPool->getConnectionForTable(
'pages');
753 $databaseConnectionForPages->insert(
765 'perms_groupid' => 1,
768 'perms_everybody' => 1
771 $pageUid = $databaseConnectionForPages->lastInsertId(
'pages');
774 $connectionPool->getConnectionForTable(
'sys_template')->insert(
781 'title' =>
'Main TypoScript Rendering',
782 'sitetitle' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'],
785 'include_static_file' =>
'EXT:fluid_styled_content/Configuration/TypoScript/,EXT:fluid_styled_content/Configuration/TypoScript/Styling/',
787 'config' =>
'page = PAGE
790 <div style="width: 800px; margin: 15% auto;">
791 <div style="width: 300px;">
792 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 42"><path d="M60.2 14.4v27h-3.8v-27h-6.7v-3.3h17.1v3.3h-6.6zm20.2 12.9v14h-3.9v-14l-7.7-16.2h4.1l5.7 12.2 5.7-12.2h3.9l-7.8 16.2zm19.5 2.6h-3.6v11.4h-3.8V11.1s3.7-.3 7.3-.3c6.6 0 8.5 4.1 8.5 9.4 0 6.5-2.3 9.7-8.4 9.7m.4-16c-2.4 0-4.1.3-4.1.3v12.6h4.1c2.4 0 4.1-1.6 4.1-6.3 0-4.4-1-6.6-4.1-6.6m21.5 27.7c-7.1 0-9-5.2-9-15.8 0-10.2 1.9-15.1 9-15.1s9 4.9 9 15.1c.1 10.6-1.8 15.8-9 15.8m0-27.7c-3.9 0-5.2 2.6-5.2 12.1 0 9.3 1.3 12.4 5.2 12.4 3.9 0 5.2-3.1 5.2-12.4 0-9.4-1.3-12.1-5.2-12.1m19.9 27.7c-2.1 0-5.3-.6-5.7-.7v-3.1c1 .2 3.7.7 5.6.7 2.2 0 3.6-1.9 3.6-5.2 0-3.9-.6-6-3.7-6H138V24h3.1c3.5 0 3.7-3.6 3.7-5.3 0-3.4-1.1-4.8-3.2-4.8-1.9 0-4.1.5-5.3.7v-3.2c.5-.1 3-.7 5.2-.7 4.4 0 7 1.9 7 8.3 0 2.9-1 5.5-3.3 6.3 2.6.2 3.8 3.1 3.8 7.3 0 6.6-2.5 9-7.3 9"/><path fill="#FF8700" d="M31.7 28.8c-.6.2-1.1.2-1.7.2-5.2 0-12.9-18.2-12.9-24.3 0-2.2.5-3 1.3-3.6C12 1.9 4.3 4.2 1.9 7.2 1.3 8 1 9.1 1 10.6c0 9.5 10.1 31 17.3 31 3.3 0 8.8-5.4 13.4-12.8M28.4.5c6.6 0 13.2 1.1 13.2 4.8 0 7.6-4.8 16.7-7.2 16.7-4.4 0-9.9-12.1-9.9-18.2C24.5 1 25.6.5 28.4.5"/></svg>
794 <h4 style="font-family: sans-serif;">Welcome to a default website made with <a href="https://typo3.org">TYPO3</a></h4>
797 page.100 =< styles.content.get',
798 'description' =>
'This is an Empty Site Package TypoScript template.
800 For each website you need a TypoScript template on the main page of your website (on the top level). For better maintenance all TypoScript should be extracted into external files via @import \'EXT:site_myproject/Configuration/TypoScript/setup.typoscript\''
810 $registry = GeneralUtility::makeInstance(Registry::class);
811 if (!empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'ext/install'][
'update'])) {
812 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'ext/install'][
'update'] as $updateClassName) {
813 if (!in_array(RepeatableInterface::class, class_implements($updateClassName),
true)) {
814 $registry->set(
'installUpdate', $updateClassName, 1);
818 $registry->set(
'installUpdateRows',
'rowUpdatersDone', GeneralUtility::makeInstance(DatabaseRowsUpdateWizard::class)->getAvailableRowUpdater());
820 $configurationManager =
new ConfigurationManager();
821 $configurationManager->setLocalConfigurationValuesByPathValuePairs($configurationValues);
824 $formProtection->clean();
830 'redirect' => GeneralUtility::getIndpEnv(
'TYPO3_SITE_URL') . TYPO3_mainDir .
'index.php',
843 $viewRootPath = GeneralUtility::getFileAbsFileName(
'EXT:install/Resources/Private/');
844 $view = GeneralUtility::makeInstance(StandaloneView::class);
845 $view->getRequest()->setControllerExtensionName(
'Install');
846 $view->setTemplatePathAndFilename($viewRootPath .
'Templates/' . $templatePath);
847 $view->setLayoutRootPaths([$viewRootPath .
'Layouts/']);
848 $view->setPartialRootPaths([$viewRootPath .
'Partials/']);
860 GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionByName(
'Default')->ping();
861 }
catch (DBALException $e) {
876 $configurationComplete =
true;
877 if (!isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'user'])) {
878 $configurationComplete =
false;
880 if (!isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'password'])) {
881 $configurationComplete =
false;
883 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'driver'])
884 &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'driver'] ===
'pdo_sqlite'
885 && !empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'path'])
887 $configurationComplete =
true;
889 return $configurationComplete;
899 $socket =
$GLOBALS[
'TYPO3_CONF_VARS'][
'DB'][
'Connections'][
'Default'][
'unix_socket'] ??
'';
900 if ($socket ===
'') {
902 $defaultSocket = (string)ini_get(
'mysqli.default_socket');
903 if ($defaultSocket !==
'') {
904 $socket = $defaultSocket;
917 $envCredentials = [];
918 foreach ([
'driver',
'host',
'user',
'password',
'port',
'dbname',
'unix_socket'] as $value) {
919 $envVar =
'TYPO3_INSTALL_DB_' . strtoupper($value);
920 if (getenv($envVar) !==
false) {
921 $envCredentials[$value] = getenv($envVar);
924 if (!empty($envCredentials)) {
925 $connectionParams = $envCredentials;
926 $connectionParams[
'wrapperClass'] = Connection::class;
927 $connectionParams[
'charset'] =
'utf-8';
929 DriverManager::getConnection($connectionParams)->ping();
930 return $envCredentials;
931 }
catch (DBALException $e) {
946 unset($connectionParams[
'dbname']);
952 $connection = DriverManager::getConnection($connectionParams);
953 $databaseArray = $connection->getSchemaManager()->listDatabases();
954 $connection->close();
957 $reservedDatabaseNames = [
'mysql',
'information_schema',
'performance_schema'];
958 $allPossibleDatabases = array_diff($databaseArray, $reservedDatabaseNames);
962 foreach ($allPossibleDatabases as $databaseName) {
967 $connectionParams[
'dbname'] = $databaseName;
968 $connection = DriverManager::getConnection($connectionParams);
971 'name' => $databaseName,
972 'tables' => count($connection->getSchemaManager()->listTableNames()),
974 $connection->close();
990 'Given database name must be shorter than fifty characters'
991 .
' and consist solely of basic latin letters (a-z), digits (0-9), dollar signs ($)'
992 .
' and underscores (_).',
993 'Database name not valid',
998 GeneralUtility::makeInstance(ConnectionPool::class)
1000 ->getSchemaManager()
1001 ->createDatabase($dbName);
1002 GeneralUtility::makeInstance(ConfigurationManager::class)
1003 ->setLocalConfigurationValueByPath(
'DB/Connections/Default/dbname', $dbName);
1004 }
catch (DBALException $e) {
1006 'Database with name "' . $dbName .
'" could not be created.'
1007 .
' Either your database name contains a reserved keyword or your database'
1008 .
' user does not have sufficient permissions to create it or the database already exists.'
1009 .
' Please choose an existing (empty) database, choose another name or contact administration.',
1010 'Unable to create database',
1028 return strlen($databaseName) <= 50 && preg_match(
'/^[a-zA-Z0-9\$_]*$/', $databaseName);
1042 $localConfigurationPathValuePairs = [];
1043 $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
1047 $connection = GeneralUtility::makeInstance(ConnectionPool::class)
1050 if (!empty($connection->getSchemaManager()->listTableNames())) {
1052 sprintf(
'Cannot use database "%s"', $dbName)
1053 .
', because it already contains tables. Please select a different database or choose to create one!',
1054 'Selected database is not empty!',
1060 sprintf(
'Could not connect to database "%s"', $dbName)
1061 .
'! Make sure it really exists and your database user has the permissions to select it!',
1062 'Could not connect to selected database!',
1068 $localConfigurationPathValuePairs[
'DB/Connections/Default/dbname'] = $dbName;
1073 if (strpos($defaultDatabaseCharset,
'utf8') !== 0) {
1075 'Your database uses character set "' . $defaultDatabaseCharset .
'", '
1076 .
'but only "utf8" and "utf8mb4" are supported with TYPO3. You probably want to change this before proceeding.',
1082 if ($result->getSeverity() ===
FlashMessage::OK && !empty($localConfigurationPathValuePairs)) {
1083 $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
1101 $connection = GeneralUtility::makeInstance(ConnectionPool::class)
1103 $queryBuilder = $connection->createQueryBuilder();
1104 $defaultDatabaseCharset = $queryBuilder->select(
'DEFAULT_CHARACTER_SET_NAME')
1105 ->from(
'information_schema.SCHEMATA')
1107 $queryBuilder->expr()->eq(
1109 $queryBuilder->createNamedParameter($dbName, \PDO::PARAM_STR)
1116 return (
string)$defaultDatabaseCharset;
1134 Argon2iPasswordHash::class,
1135 BcryptPasswordHash::class,
1136 Pbkdf2PasswordHash::class,
1137 PhpassPasswordHash::class,
1139 foreach ($okHashMethods as $className) {
1141 $instance = GeneralUtility::makeInstance($className);
1142 if ($instance->isAvailable()) {
1143 return $instance->getHashedPassword($password);
1146 throw new \LogicException(
'No suitable hash method found', 1533988846);
1161 $sqlReader = GeneralUtility::makeInstance(SqlReader::class);
1162 $sqlCode = $sqlReader->getTablesDefinitionString(
true);
1163 $schemaMigrationService = GeneralUtility::makeInstance(SchemaMigrator::class);
1164 $createTableStatements = $sqlReader->getCreateTableStatementArray($sqlCode);
1165 $results = $schemaMigrationService->install($createTableStatements);
1168 $results = array_filter($results);
1169 if (count($results) === 0) {
1170 $insertStatements = $sqlReader->getInsertStatementArray($sqlCode);
1171 $results = $schemaMigrationService->importStaticData($insertStatements);
1173 foreach ($results as $statement => &$message) {
1174 if ($message ===
'') {
1175 unset($results[$statement]);
1179 'Query:' . LF .
' ' . $statement . LF .
'Error:' . LF .
' ' . $message,
1180 'Database query failed!',
1184 return array_values($results);
1212 $normalizedParams = $request->getAttribute(
'normalizedParams',
null);
1215 $request->getServerParams(),
1223 $siteConfiguration = GeneralUtility::makeInstance(
1224 SiteConfiguration::class,
1227 $siteConfiguration->write($identifier, [
1228 'rootPageId' => $rootPageId,
1229 'base' => $normalizedParams->getSiteUrl(),
1232 'title' =>
'English',
1236 'typo3Language' =>
'default',
1237 'locale' =>
'en_US.UTF-8',
1238 'iso-639-1' =>
'en',
1239 'navigationTitle' =>
'English',
1240 'hreflang' =>
'en-us',
1241 'direction' =>
'ltr',
1245 'errorHandling' => [],