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

Public Member Functions

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 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 ()
 
array getDatabaseConfigurationFromEnvironment ()
 
array getDatabaseList ()
 
FlashMessage createNewDatabase ($dbName)
 
bool isValidDatabaseName ($databaseName)
 
FlashMessage checkExistingDatabase ($dbName)
 
string getDefaultDatabaseCharset (string $dbName)
 
string getHashedPassword ($password)
 
FlashMessage[] importDatabaseData ()
 
 loadExtLocalconfDatabaseAndExtTables ()
 
 createSiteConfiguration (string $identifier, int $rootPageId, ServerRequestInterface $request)
 

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

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 246 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 589 of file InstallerController.php.

◆ checkDatabaseSelectAction()

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

Check if a database needs to be selected

Returns
‪ResponseInterface

Definition at line 499 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 116 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 1039 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME, TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, TYPO3\CMS\Install\Controller\InstallerController\getDefaultDatabaseCharset(), and TYPO3\CMS\Core\Messaging\AbstractMessage\OK.

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

◆ checkTrustedHostsPatternAction()

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

Check if trusted hosts pattern needs to be adjusted

Returns
‪ResponseInterface

Definition at line 199 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 1210 of file InstallerController.php.

References $GLOBALS, TYPO3\CMS\Core\Core\Environment\getConfigPath(), TYPO3\CMS\Core\Core\Environment\getCurrentScript(), and TYPO3\CMS\Core\Core\Environment\getPublicPath().

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 211 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 625 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)

Select / create and test a database

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 548 of file InstallerController.php.

References TYPO3\CMS\Install\Controller\InstallerController\checkExistingDatabase(), TYPO3\CMS\Install\Controller\InstallerController\createNewDatabase(), and TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR.

◆ executeDefaultConfigurationAction()

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

◆ executeEnvironmentAndFoldersAction()

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

Create main folder layout, LocalConfiguration, PackageStates

Returns
‪ResponseInterface

Definition at line 157 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 227 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 915 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

Returns configured socket, if set.

Returns
‪string

Definition at line 897 of file InstallerController.php.

References $GLOBALS.

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

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

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

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

◆ getDefaultDatabaseCharset()

string TYPO3\CMS\Install\Controller\InstallerController::getDefaultDatabaseCharset ( string  $dbName)
protected

Retrieves the default character set of the database.

Todo:
‪this function is MySQL specific. If the core has migrated to Doctrine it should be reexamined whether this function and the check in $this->checkExistingDatabase could be deleted and utf8 otherwise enforced (guaranteeing compatibility with other database servers).
Parameters
string$dbName
Returns
‪string

Definition at line 1099 of file InstallerController.php.

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

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

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

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

◆ importDatabaseData()

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

◆ initAction()

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

Init action loads <head> with JS initiating further stuff

Returns
‪ResponseInterface

Definition at line 70 of file InstallerController.php.

References 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 874 of file InstallerController.php.

References $GLOBALS.

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 trown

Returns
‪bool

Definition at line 857 of file InstallerController.php.

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

◆ isValidDatabaseName()

bool TYPO3\CMS\Install\Controller\InstallerController::isValidDatabaseName (   $databaseName)
protected

Validate the database name against the lowest common denominator of valid identifiers across different DBMS

Parameters
string$databaseName
Returns
‪bool

Definition at line 1026 of file InstallerController.php.

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

◆ loadExtLocalconfDatabaseAndExtTables()

TYPO3\CMS\Install\Controller\InstallerController::loadExtLocalconfDatabaseAndExtTables ( )
protected

Some actions like the database analyzer and the upgrade wizards need additional bootstrap actions performed.

Those actions can potentially fatal if some old extension is loaded that triggers a fatal in ext_localconf or ext_tables code! Use only if really needed.

Definition at line 1194 of file InstallerController.php.

References TYPO3\CMS\Core\Core\Bootstrap\loadBaseTca(), TYPO3\CMS\Core\Core\Bootstrap\loadExtTables(), TYPO3\CMS\Core\Core\Bootstrap\loadTypo3LoadedExtAndExtLocalconf(), and TYPO3\CMS\Core\Core\Bootstrap\unsetReservedGlobalVariables().

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

◆ mainLayoutAction()

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

Main layout with progress bar, header

Returns
‪ResponseInterface

Definition at line 88 of file InstallerController.php.

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

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

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