‪TYPO3CMS  ‪main
TYPO3\CMS\Install\Service\SetupService Class Reference

Public Member Functions

 __construct (private readonly ConfigurationManager $configurationManager, private readonly SiteConfiguration $siteConfiguration,)
 
 setSiteName (string $name)
 
 createSiteConfiguration (string $identifier, int $rootPageId, string $siteUrl)
 
 createUser (string $username, string $password, string $email='')
 
 setInstallToolPassword (string $password)
 
 prepareSystemSettings (bool $forceOverwrite=false)
 
 createSite ()
 

Private Member Functions

string getHashedPassword (string $password)
 

Detailed Description

Service class helping to manage parts of the setup process (set configuration, create backend user, create a basic site)

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 38 of file SetupService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\Service\SetupService::__construct ( private readonly ConfigurationManager  $configurationManager,
private readonly SiteConfiguration  $siteConfiguration 
)

Definition at line 40 of file SetupService.php.

Member Function Documentation

◆ createSite()

TYPO3\CMS\Install\Service\SetupService::createSite ( )

Definition at line 155 of file SetupService.php.

◆ createSiteConfiguration()

TYPO3\CMS\Install\Service\SetupService::createSiteConfiguration ( string  $identifier,
int  $rootPageId,
string  $siteUrl 
)

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

Exceptions
SiteConfigurationWriteException

Definition at line 54 of file SetupService.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

◆ createUser()

TYPO3\CMS\Install\Service\SetupService::createUser ( string  $username,
string  $password,
string  $email = '' 
)

Create a backend user with maintainer and admin flag set by default, because the initial user always requires these flags to grant full permissions to the system.

Definition at line 94 of file SetupService.php.

References $GLOBALS, and TYPO3\CMS\Install\Service\SetupService\getHashedPassword().

◆ getHashedPassword()

string TYPO3\CMS\Install\Service\SetupService::getHashedPassword ( string  $password)
private

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

Definition at line 71 of file SetupService.php.

Referenced by TYPO3\CMS\Install\Service\SetupService\createUser(), and TYPO3\CMS\Install\Service\SetupService\setInstallToolPassword().

◆ prepareSystemSettings()

TYPO3\CMS\Install\Service\SetupService::prepareSystemSettings ( bool  $forceOverwrite = false)
Exceptions
ExistingTargetFileNameException

Definition at line 127 of file SetupService.php.

◆ setInstallToolPassword()

TYPO3\CMS\Install\Service\SetupService::setInstallToolPassword ( string  $password)

◆ setSiteName()

TYPO3\CMS\Install\Service\SetupService::setSiteName ( string  $name)

Definition at line 45 of file SetupService.php.