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

Public Member Functions

 __construct (LateBootService $lateBootService, SilentConfigurationUpgradeService $silentConfigurationUpgradeService, SilentTemplateFileUpgradeService $silentTemplateFileUpgradeService, ConfigurationManager $configurationManager, SiteConfiguration $siteConfiguration, Registry $registry, FailsafePackageManager $packageManager, VerifyHostHeader $verifyHostHeader, PermissionsCheck $databasePermissionsCheck)
 
ResponseInterface initAction ()
 
ResponseInterface mainLayoutAction ()
 
ResponseInterface showInstallerNotAvailableAction ()
 
ResponseInterface checkEnvironmentAndFoldersAction ()
 
ResponseInterface showEnvironmentAndFoldersAction ()
 
ResponseInterface executeEnvironmentAndFoldersAction ()
 
ResponseInterface checkTrustedHostsPatternAction (ServerRequestInterface $request)
 
ResponseInterface executeAdjustTrustedHostsPatternAction (ServerRequestInterface $request)
 
ResponseInterface executeSilentConfigurationUpdateAction ()
 
ResponseInterface executeSilentTemplateFileUpdateAction ()
 
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
 
SilentTemplateFileUpgradeService $silentTemplateFileUpgradeService
 
ConfigurationManager $configurationManager
 
SiteConfiguration $siteConfiguration
 
Registry $registry
 
FailsafePackageManager $packageManager
 
VerifyHostHeader $verifyHostHeader
 
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 78 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 340 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 866 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 632 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 199 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 1356 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 ( ServerRequestInterface  $request)

Check if trusted hosts pattern needs to be adjusted

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 270 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 1471 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 ( ServerRequestInterface  $request)

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

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 286 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 902 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 1006 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Backend\Routing\RouteRedirect\create(), TYPO3\CMS\Install\Controller\InstallerController\createSiteConfiguration(), TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get(), 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 240 of file InstallerController.php.

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

◆ 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 304 of file InstallerController.php.

◆ executeSilentTemplateFileUpdateAction()

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

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

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

Definition at line 322 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 1228 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 1259 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 1406 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 1430 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 ( )

◆ 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 1167 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 1146 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 171 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 185 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

◆ $silentTemplateFileUpgradeService

SilentTemplateFileUpgradeService TYPO3\CMS\Install\Controller\InstallerController::$silentTemplateFileUpgradeService
private

◆ $siteConfiguration

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

◆ $verifyHostHeader

VerifyHostHeader TYPO3\CMS\Install\Controller\InstallerController::$verifyHostHeader
private