‪TYPO3CMS  9.5
InstallerController.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
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;
58 
64 {
70  public function ‪initAction(): ResponseInterface
71  {
72  $view = $this->‪initializeStandaloneView('Installer/Init.html');
73  return new ‪HtmlResponse(
74  $view->render(),
75  200,
76  [
77  'Cache-Control' => 'no-cache, must-revalidate',
78  'Pragma' => 'no-cache'
79  ]
80  );
81  }
82 
88  public function ‪mainLayoutAction(): ResponseInterface
89  {
90  $view = $this->‪initializeStandaloneView('Installer/MainLayout.html');
91  return new ‪JsonResponse([
92  'success' => true,
93  'html' => $view->render(),
94  ]);
95  }
96 
102  public function ‪showInstallerNotAvailableAction(): ResponseInterface
103  {
104  $view = $this->‪initializeStandaloneView('Installer/ShowInstallerNotAvailable.html');
105  return new ‪JsonResponse([
106  'success' => true,
107  'html' => $view->render(),
108  ]);
109  }
110 
116  public function ‪checkEnvironmentAndFoldersAction(): ResponseInterface
117  {
118  return new ‪JsonResponse([
119  'success' => @is_file(GeneralUtility::makeInstance(ConfigurationManager::class)->getLocalConfigurationFileLocation()),
120  ]);
121  }
122 
128  public function ‪showEnvironmentAndFoldersAction(): ResponseInterface
129  {
130  $view = $this->‪initializeStandaloneView('Installer/ShowEnvironmentAndFolders.html');
131  $systemCheckMessageQueue = new ‪FlashMessageQueue('install');
132  $checkMessages = (new ‪Check())->getStatus();
133  foreach ($checkMessages as $message) {
134  $systemCheckMessageQueue->enqueue($message);
135  }
136  $setupCheckMessages = (new ‪SetupCheck())->getStatus();
137  foreach ($setupCheckMessages as $message) {
138  $systemCheckMessageQueue->enqueue($message);
139  }
140  $folderStructureFactory = GeneralUtility::makeInstance(DefaultFactory::class);
141  $structureFacade = $folderStructureFactory->getStructure();
142  $structureMessageQueue = $structureFacade->getStatus();
143  return new ‪JsonResponse([
144  'success' => true,
145  'html' => $view->render(),
146  'environmentStatusErrors' => $systemCheckMessageQueue->getAllMessages(‪FlashMessage::ERROR),
147  'environmentStatusWarnings' => $systemCheckMessageQueue->getAllMessages(‪FlashMessage::WARNING),
148  'structureErrors' => $structureMessageQueue->getAllMessages(‪FlashMessage::ERROR),
149  ]);
150  }
151 
157  public function ‪executeEnvironmentAndFoldersAction(): ResponseInterface
158  {
159  $folderStructureFactory = GeneralUtility::makeInstance(DefaultFactory::class);
160  $structureFacade = $folderStructureFactory->getStructure();
161  $structureFixMessageQueue = $structureFacade->fix();
162  $errorsFromStructure = $structureFixMessageQueue->getAllMessages(‪FlashMessage::ERROR);
163 
164  if (@is_dir(‪Environment::getLegacyConfigPath())) {
165  $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
166  $configurationManager->createLocalConfigurationFromFactoryConfiguration();
167 
168  // Create a PackageStates.php with all packages activated marked as "part of factory default"
169  if (!file_exists(‪Environment::getLegacyConfigPath() . '/PackageStates.php')) {
170  $packageManager = GeneralUtility::makeInstance(PackageManager::class);
171  $packages = $packageManager->getAvailablePackages();
172  foreach ($packages as $package) {
173  if ($package instanceof ‪PackageInterface
174  && $package->‪isPartOfFactoryDefault()
175  ) {
176  $packageManager->activatePackage($package->getPackageKey());
177  }
178  }
179  $packageManager->forceSortAndSavePackageStates();
180  }
181  $extensionConfiguration = new ‪ExtensionConfiguration();
182  $extensionConfiguration->synchronizeExtConfTemplateWithLocalConfigurationOfAllExtensions();
183 
184  return new ‪JsonResponse([
185  'success' => true,
186  ]);
187  }
188  return new ‪JsonResponse([
189  'success' => false,
190  'status' => $errorsFromStructure,
191  ]);
192  }
193 
199  public function ‪checkTrustedHostsPatternAction(): ResponseInterface
200  {
201  return new ‪JsonResponse([
202  'success' => GeneralUtility::hostHeaderValueMatchesTrustedHostsPattern($_SERVER['HTTP_HOST']),
203  ]);
204  }
205 
211  public function ‪executeAdjustTrustedHostsPatternAction(): ResponseInterface
212  {
213  if (!GeneralUtility::hostHeaderValueMatchesTrustedHostsPattern($_SERVER['HTTP_HOST'])) {
214  $configurationManager = new ConfigurationManager();
215  $configurationManager->setLocalConfigurationValueByPath('SYS/trustedHostsPattern', '.*');
216  }
217  return new ‪JsonResponse([
218  'success' => true,
219  ]);
220  }
221 
227  public function ‪executeSilentConfigurationUpdateAction(): ResponseInterface
228  {
229  $silentUpdate = new ‪SilentConfigurationUpgradeService();
230  $success = true;
231  try {
232  $silentUpdate->execute();
233  } catch (‪ConfigurationChangedException $e) {
234  $success = false;
235  }
236  return new ‪JsonResponse([
237  'success' => $success,
238  ]);
239  }
240 
246  public function ‪checkDatabaseConnectAction(): ResponseInterface
247  {
248  return new ‪JsonResponse([
249  'success' => $this->‪isDatabaseConnectSuccessful() && $this->‪isDatabaseConfigurationComplete(),
250  ]);
251  }
252 
258  public function ‪showDatabaseConnectAction(): ResponseInterface
259  {
260  $view = $this->‪initializeStandaloneView('Installer/ShowDatabaseConnect.html');
261  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
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,
271  ];
272  $host = ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] ?? '127.0.0.1';
273  if ($host === 'localhost') {
274  $host = '127.0.0.1';
275  }
276  $mysqliManualConfigurationOptions['host'] = $host;
277  $view->assign('mysqliManualConfigurationOptions', $mysqliManualConfigurationOptions);
278  $activeAvailableOption = 'mysqliManualConfiguration';
279 
280  $view->assign('hasMysqliSocketManualConfiguration', true);
281  $view->assign(
282  'mysqliSocketManualConfigurationOptions',
283  [
284  'username' => ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'] ?? '',
285  'password' => ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'] ?? '',
286  'socket' => $this->‪getDatabaseConfiguredMysqliSocket(),
287  ]
288  );
289  if (‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['driver'] === 'mysqli'
290  && ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] === 'localhost') {
291  $activeAvailableOption = 'mysqliSocketManualConfiguration';
292  }
293  }
294  if (extension_loaded('pdo_pgsql')) {
295  $hasAtLeastOneOption = true;
296  $view->assign('hasPostgresManualConfiguration', true);
297  $view->assign(
298  'postgresManualConfigurationOptions',
299  [
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'] ?? '',
305  ]
306  );
307  if (‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['driver'] === 'pdo_pgsql') {
308  $activeAvailableOption = 'postgresManualConfiguration';
309  }
310  }
311  if (extension_loaded('pdo_sqlite')) {
312  $hasAtLeastOneOption = true;
313  $view->assign('hasSqliteManualConfiguration', true);
314  $view->assign(
315  'sqliteManualConfigurationOptions',
316  []
317  );
318  if (‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['driver'] === 'pdo_sqlite') {
319  $activeAvailableOption = 'sqliteManualConfiguration';
320  }
321  }
322 
323  if (!empty($this->‪getDatabaseConfigurationFromEnvironment())) {
324  $hasAtLeastOneOption = true;
325  $activeAvailableOption = 'configurationFromEnvironment';
326  $view->assign('hasConfigurationFromEnvironment', true);
327  }
328 
329  $view->assignMultiple([
330  'hasAtLeastOneOption' => $hasAtLeastOneOption,
331  'activeAvailableOption' => $activeAvailableOption,
332  'executeDatabaseConnectToken' => $formProtection->generateToken('installTool', 'executeDatabaseConnect'),
333  ]);
334 
335  return new ‪JsonResponse([
336  'success' => true,
337  'html' => $view->render(),
338  ]);
339  }
340 
347  public function ‪executeDatabaseConnectAction(ServerRequestInterface $request): ResponseInterface
348  {
349  $messages = [];
350  $postValues = $request->getParsedBody()['install']['values'];
351  $defaultConnectionSettings = [];
352 
353  if ($postValues['availableSet'] === 'configurationFromEnvironment') {
354  $defaultConnectionSettings = $this->‪getDatabaseConfigurationFromEnvironment();
355  } else {
356  if (isset($postValues['driver'])) {
357  $validDrivers = [
358  'mysqli',
359  'pdo_mysql',
360  'pdo_pgsql',
361  'mssql',
362  'pdo_sqlite',
363  ];
364  if (in_array($postValues['driver'], $validDrivers, true)) {
365  $defaultConnectionSettings['driver'] = $postValues['driver'];
366  } else {
367  $messages[] = new ‪FlashMessage(
368  'Given driver must be one of ' . implode(', ', $validDrivers),
369  'Database driver unknown',
371  );
372  }
373  }
374  if (isset($postValues['username'])) {
375  $value = $postValues['username'];
376  if (strlen($value) <= 50) {
377  $defaultConnectionSettings['user'] = $value;
378  } else {
379  $messages[] = new ‪FlashMessage(
380  'Given username must be shorter than fifty characters.',
381  'Database username not valid',
383  );
384  }
385  }
386  if (isset($postValues['password'])) {
387  $defaultConnectionSettings['password'] = $postValues['password'];
388  }
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;
393  } else {
394  $messages[] = new ‪FlashMessage(
395  'Given host is not alphanumeric (a-z, A-Z, 0-9 or _-.:) or longer than 255 characters.',
396  'Database host not valid',
398  );
399  }
400  }
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;
405  } else {
406  $messages[] = new ‪FlashMessage(
407  'Given port is not numeric or within range 1 to 65535.',
408  'Database port not valid',
410  );
411  }
412  }
413  if (isset($postValues['socket']) && $postValues['socket'] !== '') {
414  if (@file_exists($postValues['socket'])) {
415  $defaultConnectionSettings['unix_socket'] = $postValues['socket'];
416  } else {
417  $messages[] = new ‪FlashMessage(
418  'Given socket location does not exist on server.',
419  'Socket does not exist',
421  );
422  }
423  }
424  if (isset($postValues['database'])) {
425  $value = $postValues['database'];
426  if (strlen($value) <= 50) {
427  $defaultConnectionSettings['dbname'] = $value;
428  } else {
429  $messages[] = new ‪FlashMessage(
430  'Given database name must be shorter than fifty characters.',
431  'Database name not valid',
433  );
434  }
435  }
436  // For sqlite a db path is automatically calculated
437  if (isset($postValues['driver']) && $postValues['driver'] === 'pdo_sqlite') {
438  $dbFilename = '/cms-' . (new ‪Random())->generateRandomHexString(8) . '.sqlite';
439  // If the var/ folder exists outside of document root, put it into var/sqlite/
440  // Otherwise simply into typo3conf/
442  GeneralUtility::mkdir_deep(‪Environment::getVarPath() . '/sqlite');
443  $defaultConnectionSettings['path'] = ‪Environment::getVarPath() . '/sqlite' . $dbFilename;
444  } else {
445  $defaultConnectionSettings['path'] = ‪Environment::getConfigPath() . $dbFilename;
446  }
447  }
448  // For mysql, set utf8mb4 as default charset
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',
454  ];
455  }
456  }
457 
458  $success = false;
459  if (!empty($defaultConnectionSettings)) {
460  // Test connection settings and write to config if connect is successful
461  try {
462  $connectionParams = $defaultConnectionSettings;
463  $connectionParams['wrapperClass'] = Connection::class;
464  if (!isset($connectionParams['charset'])) {
465  // utf-8 as default for non mysql
466  $connectionParams['charset'] = 'utf-8';
467  }
468  DriverManager::getConnection($connectionParams)->ping();
469  $success = true;
470  } catch (DBALException $e) {
471  $messages[] = new ‪FlashMessage(
472  'Connecting to the database with given settings failed: ' . $e->getMessage(),
473  'Database connect not successful',
475  );
476  }
477  $localConfigurationPathValuePairs = [];
478  foreach ($defaultConnectionSettings as $settingsName => $value) {
479  $localConfigurationPathValuePairs['DB/Connections/Default/' . $settingsName] = $value;
480  }
481  $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
482  // Remove full default connection array
483  $configurationManager->removeLocalConfigurationKeysByPath(['DB/Connections/Default']);
484  // Write new values
485  $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
486  }
487 
488  return new ‪JsonResponse([
489  'success' => $success,
490  'status' => $messages,
491  ]);
492  }
493 
499  public function ‪checkDatabaseSelectAction(): ResponseInterface
500  {
501  $success = false;
502  if ((string)‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] !== ''
503  || (string)‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['path'] !== ''
504  ) {
505  try {
506  $success = GeneralUtility::makeInstance(ConnectionPool::class)
507  ->getConnectionByName(‪ConnectionPool::DEFAULT_CONNECTION_NAME)
508  ->ping();
509  } catch (DBALException $e) {
510  }
511  }
512  return new ‪JsonResponse([
513  'success' => $success,
514  ]);
515  }
516 
522  public function ‪showDatabaseSelectAction(): ResponseInterface
523  {
524  $view = $this->‪initializeStandaloneView('Installer/ShowDatabaseSelect.html');
525  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
526  ‪$errors = [];
527  try {
528  $view->assign('databaseList', $this->‪getDatabaseList());
529  } catch (\‪Exception $exception) {
530  ‪$errors[] = $exception->getMessage();
531  }
532  $view->assignMultiple([
533  'errors' => ‪$errors,
534  'executeDatabaseSelectToken' => $formProtection->generateToken('installTool', 'executeDatabaseSelect'),
535  ]);
536  return new ‪JsonResponse([
537  'success' => true,
538  'html' => $view->render(),
539  ]);
540  }
541 
548  public function ‪executeDatabaseSelectAction(ServerRequestInterface $request): ResponseInterface
549  {
550  $postValues = $request->getParsedBody()['install']['values'];
551  if ($postValues['type'] === 'new') {
552  $status = $this->‪createNewDatabase($postValues['new']);
553  if ($status->getSeverity() === ‪FlashMessage::ERROR) {
554  return new ‪JsonResponse([
555  'success' => false,
556  'status' => [$status],
557  ]);
558  }
559  } elseif ($postValues['type'] === 'existing' && !empty($postValues['existing'])) {
560  $status = $this->‪checkExistingDatabase($postValues['existing']);
561  if ($status->getSeverity() === ‪FlashMessage::ERROR) {
562  return new ‪JsonResponse([
563  'success' => false,
564  'status' => [$status],
565  ]);
566  }
567  } else {
568  return new ‪JsonResponse([
569  'success' => false,
570  'status' => [
571  new ‪FlashMessage(
572  'You must select a database.',
573  'No Database selected',
575  ),
576  ],
577  ]);
578  }
579  return new ‪JsonResponse([
580  'success' => true,
581  ]);
582  }
583 
589  public function ‪checkDatabaseDataAction(): ResponseInterface
590  {
591  $existingTables = GeneralUtility::makeInstance(ConnectionPool::class)
592  ->getConnectionByName('Default')
593  ->getSchemaManager()
594  ->listTableNames();
595  return new ‪JsonResponse([
596  'success' => !empty($existingTables),
597  ]);
598  }
599 
605  public function ‪showDatabaseDataAction(): ResponseInterface
606  {
607  $view = $this->‪initializeStandaloneView('Installer/ShowDatabaseData.html');
608  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
609  $view->assignMultiple([
610  'siteName' => ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
611  'executeDatabaseDataToken' => $formProtection->generateToken('installTool', 'executeDatabaseData'),
612  ]);
613  return new ‪JsonResponse([
614  'success' => true,
615  'html' => $view->render(),
616  ]);
617  }
618 
625  public function ‪executeDatabaseDataAction(ServerRequestInterface $request): ResponseInterface
626  {
627  $messages = [];
628  $configurationManager = new ConfigurationManager();
629  $postValues = $request->getParsedBody()['install']['values'];
630  $username = (string)$postValues['username'] !== '' ? $postValues['username'] : 'admin';
631  // Check password and return early if not good enough
632  $password = $postValues['password'];
633  if (empty($password) || strlen($password) < 8) {
634  $messages[] = new ‪FlashMessage(
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!',
639  );
640  return new ‪JsonResponse([
641  'success' => false,
642  'status' => $messages,
643  ]);
644  }
645  // Set site name
646  if (!empty($postValues['sitename'])) {
647  $configurationManager->setLocalConfigurationValueByPath('SYS/sitename', $postValues['sitename']);
648  }
649  try {
650  $messages = $this->‪importDatabaseData();
651  if (!empty($messages)) {
652  return new ‪JsonResponse([
653  'success' => false,
654  'status' => $messages,
655  ]);
656  }
657  } catch (‪StatementException $exception) {
658  $messages[] = new ‪FlashMessage(
659  'Error detected in SQL statement:' . LF . $exception->getMessage(),
660  'Import of database data could not be performed',
662  );
663  return new ‪JsonResponse([
664  'success' => false,
665  'status' => $messages,
666  ]);
667  }
668  // Insert admin user
669  $adminUserFields = [
670  'username' => $username,
671  'password' => $this->‪getHashedPassword($password),
672  'admin' => 1,
673  'tstamp' => ‪$GLOBALS['EXEC_TIME'],
674  'crdate' => ‪$GLOBALS['EXEC_TIME']
675  ];
676  $databaseConnection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('be_users');
677  try {
678  $databaseConnection->insert('be_users', $adminUserFields);
679  $adminUserUid = (int)$databaseConnection->lastInsertId('be_users');
680  } catch (DBALException $exception) {
681  $messages[] = new ‪FlashMessage(
682  'The administrator account could not be created. The following error occurred:' . LF
683  . $exception->getPrevious()->getMessage(),
684  'Administrator account not created!',
686  );
687  return new ‪JsonResponse([
688  'success' => false,
689  'status' => $messages,
690  ]);
691  }
692  // Set password as install tool password, add admin user to system maintainers
693  $configurationManager->setLocalConfigurationValuesByPathValuePairs([
694  'BE/installToolPassword' => $this->‪getHashedPassword($password),
695  'SYS/systemMaintainers' => [$adminUserUid]
696  ]);
697  return new ‪JsonResponse([
698  'success' => true,
699  'status' => $messages,
700  ]);
701  }
702 
708  public function ‪showDefaultConfigurationAction(): ResponseInterface
709  {
710  $view = $this->‪initializeStandaloneView('Installer/ShowDefaultConfiguration.html');
711  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
712  $view->assignMultiple([
713  'composerMode' => ‪Environment::isComposerMode(),
714  'executeDefaultConfigurationToken' => $formProtection->generateToken('installTool', 'executeDefaultConfiguration'),
715  ]);
716  return new ‪JsonResponse([
717  'success' => true,
718  'html' => $view->render(),
719  ]);
720  }
721 
728  public function ‪executeDefaultConfigurationAction(ServerRequestInterface $request): ResponseInterface
729  {
730  $featureManager = new ‪FeatureManager();
731  // Get best matching configuration presets
732  $configurationValues = $featureManager->getBestMatchingConfigurationForAllFeatures();
733  $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
734 
735  // Let the admin user redirect to the distributions page on first login
736  switch ($request->getParsedBody()['install']['values']['sitesetup']) {
737  // Update the admin backend user to show the distribution management on login
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',
742  ];
743  $connectionPool->getConnectionForTable('be_users')->update(
744  'be_users',
745  ['uc' => serialize($adminUserFirstLogin)],
746  ['admin' => 1]
747  );
748  break;
749 
750  // Create a page with UID 1 and PID1 and fluid_styled_content for page TS config, respect ownership
751  case 'createsite':
752  $databaseConnectionForPages = $connectionPool->getConnectionForTable('pages');
753  $databaseConnectionForPages->insert(
754  'pages',
755  [
756  'pid' => 0,
757  'crdate' => time(),
758  'cruser_id' => 1,
759  'tstamp' => time(),
760  'title' => 'Home',
761  'slug' => '/',
762  'doktype' => 1,
763  'is_siteroot' => 1,
764  'perms_userid' => 1,
765  'perms_groupid' => 1,
766  'perms_user' => 31,
767  'perms_group' => 31,
768  'perms_everybody' => 1
769  ]
770  );
771  $pageUid = $databaseConnectionForPages->lastInsertId('pages');
772 
773  // add a root sys_template with fluid_styled_content and a default PAGE typoscript snippet
774  $connectionPool->getConnectionForTable('sys_template')->insert(
775  'sys_template',
776  [
777  'pid' => $pageUid,
778  'crdate' => time(),
779  'cruser_id' => 1,
780  'tstamp' => time(),
781  'title' => 'Main TypoScript Rendering',
782  'sitetitle' => ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
783  'root' => 1,
784  'clear' => 1,
785  'include_static_file' => 'EXT:fluid_styled_content/Configuration/TypoScript/,EXT:fluid_styled_content/Configuration/TypoScript/Styling/',
786  'constants' => '',
787  'config' => 'page = PAGE
788 page.10 = TEXT
789 page.10.value (
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>
793  </div>
794  <h4 style="font-family: sans-serif;">Welcome to a default website made with <a href="https://typo3.org">TYPO3</a></h4>
795  </div>
796 )
797 page.100 =< styles.content.get',
798  'description' => 'This is an Empty Site Package TypoScript template.
799 
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\''
801  ]
802  );
803 
804  $this->‪createSiteConfiguration('main', (int)$pageUid, $request);
805  break;
806  }
807 
808  // Mark upgrade wizards as done
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);
815  }
816  }
817  }
818  $registry->set('installUpdateRows', 'rowUpdatersDone', GeneralUtility::makeInstance(DatabaseRowsUpdateWizard::class)->getAvailableRowUpdater());
819 
820  $configurationManager = new ConfigurationManager();
821  $configurationManager->setLocalConfigurationValuesByPathValuePairs($configurationValues);
822 
823  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
824  $formProtection->clean();
825 
827 
828  return new ‪JsonResponse([
829  'success' => true,
830  'redirect' => GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'index.php',
831  ]);
832  }
833 
841  protected function ‪initializeStandaloneView(string $templatePath): ‪StandaloneView
842  {
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/']);
849  return $view;
850  }
851 
857  protected function ‪isDatabaseConnectSuccessful(): bool
858  {
859  try {
860  GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionByName('Default')->ping();
861  } catch (DBALException $e) {
862  return false;
863  }
864  return true;
865  }
866 
875  {
876  $configurationComplete = true;
877  if (!isset(‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'])) {
878  $configurationComplete = false;
879  }
880  if (!isset(‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'])) {
881  $configurationComplete = false;
882  }
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'])
886  ) {
887  $configurationComplete = true;
888  }
889  return $configurationComplete;
890  }
891 
898  {
899  $socket = ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['unix_socket'] ?? '';
900  if ($socket === '') {
901  // If no configured socket, use default php socket
902  $defaultSocket = (string)ini_get('mysqli.default_socket');
903  if ($defaultSocket !== '') {
904  $socket = $defaultSocket;
905  }
906  }
907  return $socket;
908  }
909 
915  protected function ‪getDatabaseConfigurationFromEnvironment(): array
916  {
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);
922  }
923  }
924  if (!empty($envCredentials)) {
925  $connectionParams = $envCredentials;
926  $connectionParams['wrapperClass'] = Connection::class;
927  $connectionParams['charset'] = 'utf-8';
928  try {
929  DriverManager::getConnection($connectionParams)->ping();
930  return $envCredentials;
931  } catch (DBALException $e) {
932  return [];
933  }
934  }
935  return [];
936  }
937 
943  protected function ‪getDatabaseList()
944  {
945  $connectionParams = ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][‪ConnectionPool::DEFAULT_CONNECTION_NAME];
946  unset($connectionParams['dbname']);
947 
948  // Establishing the connection using the Doctrine DriverManager directly
949  // as we need a connection without selecting a database right away. Otherwise
950  // an invalid database name would lead to exceptions which would prevent
951  // changing the currently configured database.
952  $connection = DriverManager::getConnection($connectionParams);
953  $databaseArray = $connection->getSchemaManager()->listDatabases();
954  $connection->close();
955 
956  // Remove organizational tables from database list
957  $reservedDatabaseNames = ['mysql', 'information_schema', 'performance_schema'];
958  $allPossibleDatabases = array_diff($databaseArray, $reservedDatabaseNames);
959 
960  // In first installation we show all databases but disable not empty ones (with tables)
961  $databases = [];
962  foreach ($allPossibleDatabases as $databaseName) {
963  // Reestablising the connection for each database since there is no
964  // portable way to switch databases on the same Doctrine connection.
965  // Directly using the Doctrine DriverManager here to avoid messing with
966  // the $GLOBALS database configuration array.
967  $connectionParams['dbname'] = $databaseName;
968  $connection = DriverManager::getConnection($connectionParams);
969 
970  $databases[] = [
971  'name' => $databaseName,
972  'tables' => count($connection->getSchemaManager()->listTableNames()),
973  ];
974  $connection->close();
975  }
976 
977  return $databases;
978  }
979 
986  protected function ‪createNewDatabase($dbName)
987  {
988  if (!$this->‪isValidDatabaseName($dbName)) {
989  return new ‪FlashMessage(
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',
995  );
996  }
997  try {
998  GeneralUtility::makeInstance(ConnectionPool::class)
999  ->getConnectionByName(‪ConnectionPool::DEFAULT_CONNECTION_NAME)
1000  ->getSchemaManager()
1001  ->createDatabase($dbName);
1002  GeneralUtility::makeInstance(ConfigurationManager::class)
1003  ->setLocalConfigurationValueByPath('DB/Connections/Default/dbname', $dbName);
1004  } catch (DBALException $e) {
1005  return new ‪FlashMessage(
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',
1012  );
1013  }
1014  return new ‪FlashMessage(
1015  '',
1016  'Database created'
1017  );
1018  }
1019 
1026  protected function ‪isValidDatabaseName($databaseName)
1027  {
1028  return strlen($databaseName) <= 50 && preg_match('/^[a-zA-Z0-9\$_]*$/', $databaseName);
1029  }
1030 
1039  protected function ‪checkExistingDatabase($dbName)
1040  {
1041  $result = new ‪FlashMessage('');
1042  $localConfigurationPathValuePairs = [];
1043  $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
1044 
1045  ‪$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][‪ConnectionPool::DEFAULT_CONNECTION_NAME]['dbname'] = $dbName;
1046  try {
1047  $connection = GeneralUtility::makeInstance(ConnectionPool::class)
1048  ->getConnectionByName(‪ConnectionPool::DEFAULT_CONNECTION_NAME);
1049 
1050  if (!empty($connection->getSchemaManager()->listTableNames())) {
1051  $result = new ‪FlashMessage(
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!',
1056  );
1057  }
1058  } catch (\‪Exception $e) {
1059  $result = new ‪FlashMessage(
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!',
1064  );
1065  }
1066 
1067  if ($result->getSeverity() === ‪FlashMessage::OK) {
1068  $localConfigurationPathValuePairs['DB/Connections/Default/dbname'] = $dbName;
1069  }
1070 
1071  // check if database charset is utf-8 - also allow utf8mb4
1072  $defaultDatabaseCharset = $this->‪getDefaultDatabaseCharset($dbName);
1073  if (strpos($defaultDatabaseCharset, 'utf8') !== 0) {
1074  $result = new ‪FlashMessage(
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.',
1077  'Invalid Charset',
1079  );
1080  }
1081 
1082  if ($result->getSeverity() === ‪FlashMessage::OK && !empty($localConfigurationPathValuePairs)) {
1083  $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
1084  }
1085 
1086  return $result;
1087  }
1088 
1099  protected function ‪getDefaultDatabaseCharset(string $dbName): string
1100  {
1101  $connection = GeneralUtility::makeInstance(ConnectionPool::class)
1102  ->getConnectionByName(‪ConnectionPool::DEFAULT_CONNECTION_NAME);
1103  $queryBuilder = $connection->createQueryBuilder();
1104  $defaultDatabaseCharset = $queryBuilder->select('DEFAULT_CHARACTER_SET_NAME')
1105  ->from('information_schema.SCHEMATA')
1106  ->where(
1107  $queryBuilder->expr()->eq(
1108  'SCHEMA_NAME',
1109  $queryBuilder->createNamedParameter($dbName, \PDO::PARAM_STR)
1110  )
1111  )
1112  ->setMaxResults(1)
1113  ->execute()
1114  ->fetchColumn();
1115 
1116  return (string)$defaultDatabaseCharset;
1117  }
1118 
1131  protected function ‪getHashedPassword($password)
1132  {
1133  $okHashMethods = [
1134  Argon2iPasswordHash::class,
1135  BcryptPasswordHash::class,
1136  Pbkdf2PasswordHash::class,
1137  PhpassPasswordHash::class,
1138  ];
1139  foreach ($okHashMethods as $className) {
1141  $instance = GeneralUtility::makeInstance($className);
1142  if ($instance->isAvailable()) {
1143  return $instance->getHashedPassword($password);
1144  }
1145  }
1146  throw new \LogicException('No suitable hash method found', 1533988846);
1147  }
1148 
1154  protected function ‪importDatabaseData()
1155  {
1156  // Will load ext_localconf and ext_tables. This is pretty safe here since we are
1157  // in first install (database empty), so it is very likely that no extension is loaded
1158  // that could trigger a fatal at this point.
1160 
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);
1166 
1167  // Only keep statements with error messages
1168  $results = array_filter($results);
1169  if (count($results) === 0) {
1170  $insertStatements = $sqlReader->getInsertStatementArray($sqlCode);
1171  $results = $schemaMigrationService->importStaticData($insertStatements);
1172  }
1173  foreach ($results as $statement => &$message) {
1174  if ($message === '') {
1175  unset($results[$statement]);
1176  continue;
1177  }
1178  $message = new ‪FlashMessage(
1179  'Query:' . LF . ' ' . $statement . LF . 'Error:' . LF . ' ' . $message,
1180  'Database query failed!',
1182  );
1183  }
1184  return array_values($results);
1185  }
1186 
1195  {
1200  }
1201 
1210  protected function ‪createSiteConfiguration(string $identifier, int $rootPageId, ServerRequestInterface $request)
1211  {
1212  $normalizedParams = $request->getAttribute('normalizedParams', null);
1213  if (!($normalizedParams instanceof ‪NormalizedParams)) {
1214  $normalizedParams = new ‪NormalizedParams(
1215  $request->getServerParams(),
1216  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS'],
1219  );
1220  }
1221 
1222  // Create a default site configuration called "main" as best practice
1223  $siteConfiguration = GeneralUtility::makeInstance(
1224  SiteConfiguration::class,
1225  ‪Environment::getConfigPath() . '/sites'
1226  );
1227  $siteConfiguration->write($identifier, [
1228  'rootPageId' => $rootPageId,
1229  'base' => $normalizedParams->getSiteUrl(),
1230  'languages' => [
1231  0 => [
1232  'title' => 'English',
1233  'enabled' => true,
1234  'languageId' => 0,
1235  'base' => '/en/',
1236  'typo3Language' => 'default',
1237  'locale' => 'en_US.UTF-8',
1238  'iso-639-1' => 'en',
1239  'navigationTitle' => 'English',
1240  'hreflang' => 'en-us',
1241  'direction' => 'ltr',
1242  'flag' => 'us',
1243  ],
1244  ],
1245  'errorHandling' => [],
1246  'routes' => [],
1247  ]);
1248  }
1249 }
‪TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseSelectAction
‪ResponseInterface executeDatabaseSelectAction(ServerRequestInterface $request)
Definition: InstallerController.php:548
‪TYPO3\CMS\Install\Controller\InstallerController\isValidDatabaseName
‪bool isValidDatabaseName($databaseName)
Definition: InstallerController.php:1026
‪TYPO3\CMS\Install\Controller\InstallerController\checkEnvironmentAndFoldersAction
‪ResponseInterface checkEnvironmentAndFoldersAction()
Definition: InstallerController.php:116
‪TYPO3\CMS\Install\Controller\InstallerController\executeDefaultConfigurationAction
‪ResponseInterface executeDefaultConfigurationAction(ServerRequestInterface $request)
Definition: InstallerController.php:728
‪TYPO3\CMS\Core\Core\Bootstrap\loadBaseTca
‪static Bootstrap null loadBaseTca(bool $allowCaching=true, FrontendInterface $coreCache=null)
Definition: Bootstrap.php:832
‪TYPO3\CMS\Core\Core\Bootstrap\unsetReservedGlobalVariables
‪static Bootstrap null unsetReservedGlobalVariables()
Definition: Bootstrap.php:808
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get
‪static TYPO3 CMS Core FormProtection AbstractFormProtection get($classNameOrType='default',... $constructorArguments)
Definition: FormProtectionFactory.php:72
‪TYPO3\CMS\Core\Crypto\PasswordHashing\BcryptPasswordHash
Definition: BcryptPasswordHash.php:30
‪TYPO3\CMS\Install\Updates\RepeatableInterface
Definition: RepeatableInterface.php:25
‪TYPO3\CMS\Install\Configuration\FeatureManager
Definition: FeatureManager.php:28
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:153
‪TYPO3\CMS\Core\Database\Schema\Exception\StatementException
Definition: StatementException.php:23
‪TYPO3\CMS\Install\Controller\InstallerController\checkDatabaseConnectAction
‪ResponseInterface checkDatabaseConnectAction()
Definition: InstallerController.php:246
‪TYPO3\CMS\Install\Controller\InstallerController\createSiteConfiguration
‪createSiteConfiguration(string $identifier, int $rootPageId, ServerRequestInterface $request)
Definition: InstallerController.php:1210
‪TYPO3\CMS\Install\Service\Exception\ConfigurationChangedException
Definition: ConfigurationChangedException.php:24
‪TYPO3\CMS\Core\Configuration\ExtensionConfiguration
Definition: ExtensionConfiguration.php:42
‪TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseDataAction
‪ResponseInterface executeDatabaseDataAction(ServerRequestInterface $request)
Definition: InstallerController.php:625
‪TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService
Definition: SilentConfigurationUpgradeService.php:42
‪TYPO3\CMS\Core\Package\PackageInterface\isPartOfFactoryDefault
‪bool isPartOfFactoryDefault()
‪TYPO3\CMS\Install\Controller\InstallerController\getDatabaseConfiguredMysqliSocket
‪string getDatabaseConfiguredMysqliSocket()
Definition: InstallerController.php:897
‪TYPO3\CMS\Install\Controller\InstallerController\checkDatabaseDataAction
‪ResponseInterface checkDatabaseDataAction()
Definition: InstallerController.php:589
‪TYPO3\CMS\Core\Registry
Definition: Registry.php:32
‪TYPO3\CMS\Core\Core\Environment\getCurrentScript
‪static string getCurrentScript()
Definition: Environment.php:193
‪TYPO3\CMS\Install\Service\EnableFileService
Definition: EnableFileService.php:24
‪TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseConnectAction
‪ResponseInterface executeDatabaseConnectAction(ServerRequestInterface $request)
Definition: InstallerController.php:347
‪TYPO3\CMS\Install\Controller\InstallerController\createNewDatabase
‪FlashMessage createNewDatabase($dbName)
Definition: InstallerController.php:986
‪TYPO3\CMS\Install\FolderStructure\DefaultFactory
Definition: DefaultFactory.php:24
‪TYPO3\CMS\Install\Controller\InstallerController\getDatabaseConfigurationFromEnvironment
‪array getDatabaseConfigurationFromEnvironment()
Definition: InstallerController.php:915
‪TYPO3\CMS\Install\Controller\InstallerController\checkDatabaseSelectAction
‪ResponseInterface checkDatabaseSelectAction()
Definition: InstallerController.php:499
‪TYPO3\CMS\Install\Controller\InstallerController\loadExtLocalconfDatabaseAndExtTables
‪loadExtLocalconfDatabaseAndExtTables()
Definition: InstallerController.php:1194
‪TYPO3\CMS\Core\Database\Schema\SqlReader
Definition: SqlReader.php:29
‪TYPO3\CMS\Install\Controller\InstallerController\getDefaultDatabaseCharset
‪string getDefaultDatabaseCharset(string $dbName)
Definition: InstallerController.php:1099
‪TYPO3\CMS\Core\Configuration\SiteConfiguration
Definition: SiteConfiguration.php:38
‪TYPO3\CMS\Install\Controller\InstallerController\executeEnvironmentAndFoldersAction
‪ResponseInterface executeEnvironmentAndFoldersAction()
Definition: InstallerController.php:157
‪TYPO3\CMS\Install\Controller\InstallerController\showDatabaseSelectAction
‪ResponseInterface showDatabaseSelectAction()
Definition: InstallerController.php:522
‪TYPO3\CMS\Install\Controller\InstallerController\executeAdjustTrustedHostsPatternAction
‪ResponseInterface executeAdjustTrustedHostsPatternAction()
Definition: InstallerController.php:211
‪TYPO3\CMS\Install\Controller\InstallerController\isDatabaseConnectSuccessful
‪bool isDatabaseConnectSuccessful()
Definition: InstallerController.php:857
‪TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME
‪const DEFAULT_CONNECTION_NAME
Definition: ConnectionPool.php:48
‪TYPO3\CMS\Core\Database\Schema\SchemaMigrator
Definition: SchemaMigrator.php:35
‪TYPO3\CMS\Core\Package\PackageInterface
Definition: PackageInterface.php:21
‪TYPO3\CMS\Core\FormProtection\InstallToolFormProtection
Definition: InstallToolFormProtection.php:60
‪TYPO3\CMS\Install\Updates\DatabaseRowsUpdateWizard
Definition: DatabaseRowsUpdateWizard.php:45
‪TYPO3\CMS\Install\Controller\InstallerController\initAction
‪ResponseInterface initAction()
Definition: InstallerController.php:70
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:28
‪TYPO3\CMS\Core\Core\Environment\getProjectPath
‪static string getProjectPath()
Definition: Environment.php:142
‪TYPO3\CMS\Install\Exception
Definition: Exception.php:23
‪TYPO3\CMS\Install\Controller\InstallerController\executeSilentConfigurationUpdateAction
‪ResponseInterface executeSilentConfigurationUpdateAction()
Definition: InstallerController.php:227
‪TYPO3\CMS\Install\Service\EnableFileService\removeFirstInstallFile
‪static bool removeFirstInstallFile()
Definition: EnableFileService.php:85
‪TYPO3\CMS\Install\Controller\InstallerController\showEnvironmentAndFoldersAction
‪ResponseInterface showEnvironmentAndFoldersAction()
Definition: InstallerController.php:128
‪TYPO3\CMS\Install\Controller
Definition: AbstractController.php:3
‪TYPO3\CMS\Install\Controller\InstallerController\showDatabaseDataAction
‪ResponseInterface showDatabaseDataAction()
Definition: InstallerController.php:605
‪TYPO3\CMS\Core\Crypto\PasswordHashing\Pbkdf2PasswordHash
Definition: Pbkdf2PasswordHash.php:27
‪TYPO3\CMS\Install\Controller\InstallerController\showDefaultConfigurationAction
‪ResponseInterface showDefaultConfigurationAction()
Definition: InstallerController.php:708
‪TYPO3\CMS\Core\Core\Bootstrap\loadTypo3LoadedExtAndExtLocalconf
‪static Bootstrap null loadTypo3LoadedExtAndExtLocalconf($allowCaching=true, FrontendInterface $coreCache=null)
Definition: Bootstrap.php:551
‪TYPO3\CMS\Install\Controller\InstallerController\initializeStandaloneView
‪StandaloneView initializeStandaloneView(string $templatePath)
Definition: InstallerController.php:841
‪TYPO3\CMS\Core\Core\Bootstrap\loadExtTables
‪static Bootstrap null loadExtTables(bool $allowCaching=true)
Definition: Bootstrap.php:864
‪TYPO3\CMS\Core\Crypto\PasswordHashing\PhpassPasswordHash
Definition: PhpassPasswordHash.php:34
‪TYPO3\CMS\Install\Controller\InstallerController\checkTrustedHostsPatternAction
‪ResponseInterface checkTrustedHostsPatternAction()
Definition: InstallerController.php:199
‪TYPO3\CMS\Install\Controller\InstallerController\showDatabaseConnectAction
‪ResponseInterface showDatabaseConnectAction()
Definition: InstallerController.php:258
‪$errors
‪$errors
Definition: annotationChecker.php:115
‪TYPO3\CMS\Core\Messaging\AbstractMessage\OK
‪const OK
Definition: AbstractMessage.php:27
‪TYPO3\CMS\Install\Controller\InstallerController
Definition: InstallerController.php:64
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:31
‪TYPO3\CMS\Core\Core\Environment\isComposerMode
‪static bool isComposerMode()
Definition: Environment.php:117
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:22
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:45
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:32
‪TYPO3\CMS\Install\SystemEnvironment\Check
Definition: Check.php:51
‪TYPO3\CMS\Install\Controller\InstallerController\getHashedPassword
‪string getHashedPassword($password)
Definition: InstallerController.php:1131
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:25
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Install\Controller\InstallerController\isDatabaseConfigurationComplete
‪bool isDatabaseConfigurationComplete()
Definition: InstallerController.php:874
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Install\Controller\InstallerController\importDatabaseData
‪FlashMessage[] importDatabaseData()
Definition: InstallerController.php:1154
‪TYPO3\CMS\Install\SystemEnvironment\SetupCheck
Definition: SetupCheck.php:35
‪TYPO3\CMS\Core\Core\Environment\getConfigPath
‪static string getConfigPath()
Definition: Environment.php:183
‪TYPO3\CMS\Core\Crypto\Random
Definition: Random.php:22
‪TYPO3\CMS\Install\Controller\InstallerController\checkExistingDatabase
‪FlashMessage checkExistingDatabase($dbName)
Definition: InstallerController.php:1039
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Install\Controller\InstallerController\showInstallerNotAvailableAction
‪ResponseInterface showInstallerNotAvailableAction()
Definition: InstallerController.php:102
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface
Definition: PasswordHashInterface.php:23
‪TYPO3\CMS\Core\Messaging\FlashMessageQueue
Definition: FlashMessageQueue.php:25
‪TYPO3\CMS\Core\Crypto\PasswordHashing\Argon2iPasswordHash
Definition: Argon2iPasswordHash.php:29
‪TYPO3\CMS\Core\Core\Environment\getLegacyConfigPath
‪static string getLegacyConfigPath()
Definition: Environment.php:256
‪TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR
‪const ERROR
Definition: AbstractMessage.php:29
‪TYPO3\CMS\Install\Controller\InstallerController\mainLayoutAction
‪ResponseInterface mainLayoutAction()
Definition: InstallerController.php:88
‪TYPO3\CMS\Core\Http\NormalizedParams
Definition: NormalizedParams.php:32
‪TYPO3\CMS\Core\Http\HtmlResponse
Definition: HtmlResponse.php:25
‪TYPO3\CMS\Core\Core\Environment\getVarPath
‪static string getVarPath()
Definition: Environment.php:165
‪TYPO3\CMS\Install\Controller\InstallerController\getDatabaseList
‪array getDatabaseList()
Definition: InstallerController.php:943