‪TYPO3CMS  10.4
TYPO3\CMS\Install\Controller\InstallerController Class Reference

Public Member Functions

 __construct (LateBootService $lateBootService, SilentConfigurationUpgradeService $silentConfigurationUpgradeService, ConfigurationManager $configurationManager, SiteConfiguration $siteConfiguration, Registry $registry, FailsafePackageManager $packageManager, PermissionsCheck $databasePermissionsCheck)
 
ResponseInterface initAction ()
 
ResponseInterface mainLayoutAction ()
 
ResponseInterface showInstallerNotAvailableAction ()
 
ResponseInterface checkEnvironmentAndFoldersAction ()
 
ResponseInterface showEnvironmentAndFoldersAction ()
 
ResponseInterface executeEnvironmentAndFoldersAction ()
 
ResponseInterface checkTrustedHostsPatternAction ()
 
ResponseInterface executeAdjustTrustedHostsPatternAction ()
 
ResponseInterface executeSilentConfigurationUpdateAction ()
 
ResponseInterface checkDatabaseConnectAction ()
 
ResponseInterface showDatabaseConnectAction ()
 
ResponseInterface executeDatabaseConnectAction (ServerRequestInterface $request)
 
ResponseInterface checkDatabaseSelectAction ()
 
ResponseInterface showDatabaseSelectAction ()
 
ResponseInterface checkDatabaseRequirementsAction (ServerRequestInterface $request)
 
ResponseInterface executeDatabaseSelectAction (ServerRequestInterface $request)
 
ResponseInterface checkDatabaseDataAction ()
 
ResponseInterface showDatabaseDataAction ()
 
ResponseInterface executeDatabaseDataAction (ServerRequestInterface $request)
 
ResponseInterface showDefaultConfigurationAction ()
 
ResponseInterface executeDefaultConfigurationAction (ServerRequestInterface $request)
 

Protected Member Functions

StandaloneView initializeStandaloneView (string $templatePath)
 
bool isDatabaseConnectSuccessful ()
 
bool isDatabaseConfigurationComplete ()
 
string getDatabaseConfiguredMysqliSocket ()
 
string getDatabaseConfiguredPdoMysqlSocket ()
 
array getDatabaseConfigurationFromEnvironment ()
 
array getDatabaseList ()
 
FlashMessage createNewDatabase ($dbName)
 
FlashMessage checkExistingDatabase ($dbName)
 
string getHashedPassword ($password)
 
FlashMessage[] importDatabaseData ()
 
 createSiteConfiguration (string $identifier, int $rootPageId, ServerRequestInterface $request)
 

Private Member Functions

 checkRequiredDatabasePermissions ()
 
 checkDatabaseRequirementsForDriver (string $databaseDriverName)
 
 retrieveDatabaseNameFromRequest (ServerRequestInterface $request)
 
string getDefaultSocketFor (string $phpIniSetting)
 

Private Attributes

LateBootService $lateBootService
 
SilentConfigurationUpgradeService $silentConfigurationUpgradeService
 
ConfigurationManager $configurationManager
 
SiteConfiguration $siteConfiguration
 
Registry $registry
 
FailsafePackageManager $packageManager
 
PermissionsCheck $databasePermissionsCheck
 

Detailed Description

Install step controller, dispatcher class of step actions.

This class is a specific controller implementation and is not considered part of the Public TYPO3 API.

Definition at line 73 of file InstallerController.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ checkDatabaseConnectAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::checkDatabaseConnectAction ( )

Check if database connect step needs to be shown

Returns
‪ResponseInterface

Definition at line 303 of file InstallerController.php.

References TYPO3\CMS\Install\Controller\InstallerController\isDatabaseConfigurationComplete(), and TYPO3\CMS\Install\Controller\InstallerController\isDatabaseConnectSuccessful().

◆ checkDatabaseDataAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::checkDatabaseDataAction ( )

Check if initial data needs to be imported

Returns
‪ResponseInterface

Definition at line 823 of file InstallerController.php.

References TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME.

◆ checkDatabaseRequirementsAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::checkDatabaseRequirementsAction ( ServerRequestInterface  $request)

◆ checkDatabaseRequirementsForDriver()

TYPO3\CMS\Install\Controller\InstallerController::checkDatabaseRequirementsForDriver ( string  $databaseDriverName)
private

◆ checkDatabaseSelectAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::checkDatabaseSelectAction ( )

Check if a database needs to be selected

Returns
‪ResponseInterface

Definition at line 592 of file InstallerController.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME.

◆ checkEnvironmentAndFoldersAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::checkEnvironmentAndFoldersAction ( )

Check if "environment and folders" should be shown

Returns
‪ResponseInterface

Definition at line 177 of file InstallerController.php.

◆ checkExistingDatabase()

FlashMessage TYPO3\CMS\Install\Controller\InstallerController::checkExistingDatabase (   $dbName)
protected

Checks whether an existing database on the default connection can be used for a TYPO3 installation. The database name is only persisted to the local configuration if the database is empty.

Parameters
string$dbName‪name of the database
Returns
‪FlashMessage

Definition at line 1302 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME, TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, and TYPO3\CMS\Core\Messaging\AbstractMessage\OK.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseSelectAction().

◆ checkRequiredDatabasePermissions()

TYPO3\CMS\Install\Controller\InstallerController::checkRequiredDatabasePermissions ( )
private

◆ checkTrustedHostsPatternAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::checkTrustedHostsPatternAction ( )

Check if trusted hosts pattern needs to be adjusted

Returns
‪ResponseInterface

Definition at line 258 of file InstallerController.php.

◆ createNewDatabase()

FlashMessage TYPO3\CMS\Install\Controller\InstallerController::createNewDatabase (   $dbName)
protected

◆ createSiteConfiguration()

TYPO3\CMS\Install\Controller\InstallerController::createSiteConfiguration ( string  $identifier,
int  $rootPageId,
ServerRequestInterface  $request 
)
protected

Creates a site configuration with one language "English" which is the de-facto default language for TYPO3 in general.

Parameters
string$identifier
int$rootPageId
ServerRequestInterface$request
Exceptions

Definition at line 1417 of file InstallerController.php.

References TYPO3\CMS\Core\Http\NormalizedParams\createFromRequest().

Referenced by TYPO3\CMS\Install\Controller\InstallerController\executeDefaultConfigurationAction().

◆ executeAdjustTrustedHostsPatternAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeAdjustTrustedHostsPatternAction ( )

Adjust trusted hosts pattern to '.*' if it does not match yet

Returns
‪ResponseInterface

Definition at line 270 of file InstallerController.php.

◆ executeDatabaseConnectAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeDatabaseConnectAction ( ServerRequestInterface  $request)

◆ executeDatabaseDataAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeDatabaseDataAction ( ServerRequestInterface  $request)

Create main db layout

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 859 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, TYPO3\CMS\Install\Controller\InstallerController\getHashedPassword(), and TYPO3\CMS\Install\Controller\InstallerController\importDatabaseData().

◆ executeDatabaseSelectAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeDatabaseSelectAction ( ServerRequestInterface  $request)

◆ executeDefaultConfigurationAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeDefaultConfigurationAction ( ServerRequestInterface  $request)

Last step execution: clean up, remove FIRST_INSTALL file, ...

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 963 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Install\Controller\InstallerController\createSiteConfiguration(), TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get(), TYPO3\CMS\Core\Database\Connection\PARAM_LOB, and TYPO3\CMS\Install\Service\EnableFileService\removeFirstInstallFile().

◆ executeEnvironmentAndFoldersAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeEnvironmentAndFoldersAction ( )

Create main folder layout, LocalConfiguration, PackageStates

Returns
‪ResponseInterface

Definition at line 218 of file InstallerController.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, TYPO3\CMS\Core\Core\Environment\getLegacyConfigPath(), and TYPO3\CMS\Core\Package\PackageInterface\isPartOfFactoryDefault().

◆ executeSilentConfigurationUpdateAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::executeSilentConfigurationUpdateAction ( )

Execute silent configuration update. May be called multiple times until success = true is returned.

Returns
‪ResponseInterface success = true if no change has been done

Definition at line 285 of file InstallerController.php.

◆ getDatabaseConfigurationFromEnvironment()

array TYPO3\CMS\Install\Controller\InstallerController::getDatabaseConfigurationFromEnvironment ( )
protected

Try to fetch db credentials from a .env file and see if connect works

Returns
‪array Empty array if no file is found or connect is not successful, else working credentials

Definition at line 1179 of file InstallerController.php.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseConnectAction(), and TYPO3\CMS\Install\Controller\InstallerController\showDatabaseConnectAction().

◆ getDatabaseConfiguredMysqliSocket()

string TYPO3\CMS\Install\Controller\InstallerController::getDatabaseConfiguredMysqliSocket ( )
protected

◆ getDatabaseConfiguredPdoMysqlSocket()

string TYPO3\CMS\Install\Controller\InstallerController::getDatabaseConfiguredPdoMysqlSocket ( )
protected

◆ getDatabaseList()

array TYPO3\CMS\Install\Controller\InstallerController::getDatabaseList ( )
protected

Returns list of available databases (with access-check based on username/password)

Returns
‪array List of available databases

Definition at line 1207 of file InstallerController.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\showDatabaseSelectAction().

◆ getDefaultSocketFor()

string TYPO3\CMS\Install\Controller\InstallerController::getDefaultSocketFor ( string  $phpIniSetting)
private

◆ getHashedPassword()

string TYPO3\CMS\Install\Controller\InstallerController::getHashedPassword (   $password)
protected

This function returns a salted hashed key for new backend user password and install tool password.

This method is executed during installation before the preset did set up proper hash method selection in LocalConfiguration. So PasswordHashFactory is not usable at this point. We thus loop through the default hash mechanisms and select the first one that works. The preset calculation of step executeDefaultConfigurationAction() basically does the same later.

Parameters
string$password‪Plain text password
Returns
‪string Hashed password
Exceptions

Definition at line 1352 of file InstallerController.php.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseDataAction().

◆ importDatabaseData()

FlashMessage [] TYPO3\CMS\Install\Controller\InstallerController::importDatabaseData ( )
protected

Create tables and import static rows

Returns
‪FlashMessage[]

Definition at line 1376 of file InstallerController.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\executeDatabaseDataAction().

◆ initAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::initAction ( )

Init action loads <head> with JS initiating further stuff

Returns
‪ResponseInterface

Definition at line 126 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Core\Core\Environment\getContext(), TYPO3\CMS\Core\Core\Environment\getProjectPath(), and TYPO3\CMS\Install\Controller\InstallerController\initializeStandaloneView().

◆ initializeStandaloneView()

◆ isDatabaseConfigurationComplete()

bool TYPO3\CMS\Install\Controller\InstallerController::isDatabaseConfigurationComplete ( )
protected

Check LocalConfiguration.php for required database settings:

  • ‪'username' and 'password' are mandatory, but may be empty
  • ‪if 'driver' is pdo_sqlite and 'path' is set, its ok, too
Returns
‪bool TRUE if required settings are present

Definition at line 1118 of file InstallerController.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\checkDatabaseConnectAction().

◆ isDatabaseConnectSuccessful()

bool TYPO3\CMS\Install\Controller\InstallerController::isDatabaseConnectSuccessful ( )
protected

Test connection with given credentials and return exception message if exception thrown

Returns
‪bool

Definition at line 1099 of file InstallerController.php.

References TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\checkDatabaseConnectAction().

◆ mainLayoutAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::mainLayoutAction ( )

Main layout with progress bar, header

Returns
‪ResponseInterface

Definition at line 149 of file InstallerController.php.

References TYPO3\CMS\Install\Controller\InstallerController\initializeStandaloneView().

◆ retrieveDatabaseNameFromRequest()

TYPO3\CMS\Install\Controller\InstallerController::retrieveDatabaseNameFromRequest ( ServerRequestInterface  $request)
private

◆ showDatabaseConnectAction()

◆ showDatabaseDataAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::showDatabaseDataAction ( )

◆ showDatabaseSelectAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::showDatabaseSelectAction ( )

◆ showDefaultConfigurationAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::showDefaultConfigurationAction ( )

◆ showEnvironmentAndFoldersAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::showEnvironmentAndFoldersAction ( )

◆ showInstallerNotAvailableAction()

ResponseInterface TYPO3\CMS\Install\Controller\InstallerController::showInstallerNotAvailableAction ( )

Render "FIRST_INSTALL file need to exist" view

Returns
‪ResponseInterface

Definition at line 163 of file InstallerController.php.

References TYPO3\CMS\Install\Controller\InstallerController\initializeStandaloneView().

Member Data Documentation

◆ $configurationManager

ConfigurationManager TYPO3\CMS\Install\Controller\InstallerController::$configurationManager
private

◆ $databasePermissionsCheck

PermissionsCheck TYPO3\CMS\Install\Controller\InstallerController::$databasePermissionsCheck
private

◆ $lateBootService

LateBootService TYPO3\CMS\Install\Controller\InstallerController::$lateBootService
private

◆ $packageManager

FailsafePackageManager TYPO3\CMS\Install\Controller\InstallerController::$packageManager
private

◆ $registry

Registry TYPO3\CMS\Install\Controller\InstallerController::$registry
private

◆ $silentConfigurationUpgradeService

SilentConfigurationUpgradeService TYPO3\CMS\Install\Controller\InstallerController::$silentConfigurationUpgradeService
private

◆ $siteConfiguration

SiteConfiguration TYPO3\CMS\Install\Controller\InstallerController::$siteConfiguration
private