SetupService

readonly class \TYPO3\CMS\Install\Service\SetupService

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

Tags

phpstan-type

Distribution array{ packageKey: string, title: string, description: string, isFramework: bool }

phpstan-type

SplitDistributions array{ inactive: array<string, Distribution>, active: array<string, Distribution> }

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
activateDistributionPackage()  : void
Activate the selected distribution package in case it isn't already and make sure import export package is installed as well
createBackendUserGroups()  : string[]
Initializes backend user group presets. Currently hard-coded to editor and advanced editor.
createDirectoryStructure()  : FlashMessage[]
createSite()  : int
Create a root page and site configuration with appropriate site set dependencies, if available
createUser()  : void
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.
getAvailableDistributions()  : SplitDistributions
Returns all available packages that ship initialisation data (data.xml or data.t3d) which can (or will) be imported during installation.
markInstallationFinished()  : void
Clears the in-progress flag set by prepareSystemSettings(), so the installer can no longer run on this instance.
prepareSystemSettings()  : void
setInstallToolPassword()  : bool
setSiteName()  : bool
setupExtensions()  : void

Methods

activateDistributionPackage()

Activate the selected distribution package in case it isn't already and make sure import export package is installed as well

public activateDistributionPackage(string $packageKey) : void

Parameters

$packageKey : string

createBackendUserGroups()

Initializes backend user group presets. Currently hard-coded to editor and advanced editor.

public createBackendUserGroups([bool $createEditor = true ][, bool $createAdvancedEditor = true ][, bool $force = false ]) : string[]

When more backend user group presets are added, please refactor (maybe DTO).

Parameters

$createEditor : bool = true
$createAdvancedEditor : bool = true
$force : bool = false

Return values

string[]

createSite()

Create a root page and site configuration with appropriate site set dependencies, if available

public createSite(string $siteIdentifier, string $siteUrl) : int

Parameters

$siteIdentifier : string
$siteUrl : string

Return values

int

createUser()

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.

public createUser(string $username, string $password[, string $email = '' ]) : void

Parameters

$username : string
$password : string
$email : string = ''

getAvailableDistributions()

Returns all available packages that ship initialisation data (data.xml or data.t3d) which can (or will) be imported during installation.

public getAvailableDistributions() : SplitDistributions

Return values

SplitDistributions

markInstallationFinished()

Clears the in-progress flag set by prepareSystemSettings(), so the installer can no longer run on this instance.

public markInstallationFinished() : void

setInstallToolPassword()

public setInstallToolPassword(string $password) : bool

Parameters

$password : string

Return values

bool

setSiteName()

public setSiteName(string $name) : bool

Parameters

$name : string

Return values

bool

setupExtensions()

public setupExtensions(ContainerInterface $container) : void

Parameters

$container : ContainerInterface
On this page