SetupService

Read onlyYes

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

Internal

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

Table of Contents

Methods

__construct()  : mixed
createBackendUserGroups()  : array<string|int, string>
Initializes backend user group presets. Currently hard-coded to editor and advanced editor.
createDirectoryStructure()  : array<string|int, FlashMessage>
createSite()  : array<string|int, mixed>
createSiteConfiguration()  : void
Creates a site configuration with one language "English" which is the de-facto default language for TYPO3 in general.
createSysTemplateRecord()  : void
Creates a sys_template record with basic PAGE rendering.
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.
getDefaultSiteSetDependencies()  : array<string|int, string>
Returns the default site set dependencies based on installed packages. If the default theme is installed, it will be used. Otherwise, falls back to fluid_styled_content.
hasDefaultTheme()  : bool
Check if the default theme is available.
initializeDefaultThemeContent()  : void
prepareSystemSettings()  : void
setInstallToolPassword()  : bool
setSiteName()  : bool
writeSiteSetupTypoScript()  : bool
Writes a setup.typoscript file to the site configuration directory with basic PAGE rendering.

Methods

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 ]) : array<string|int, 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
array<string|int, string>

createSite()

public createSite() : array<string|int, mixed>
Return values
array<string|int, mixed>

createSiteConfiguration()

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

public createSiteConfiguration(string $identifier, int $rootPageId, string $siteUrl[, array<string|int, string> $dependencies = [] ]) : void
Parameters
$identifier : string
$rootPageId : int
$siteUrl : string
$dependencies : array<string|int, string> = []

Site set identifiers to add as dependencies

Tags
throws
SiteConfigurationWriteException

createSysTemplateRecord()

Creates a sys_template record with basic PAGE rendering.

public createSysTemplateRecord(mixed $pageUid) : void
Parameters
$pageUid : mixed

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 = ''

getDefaultSiteSetDependencies()

Returns the default site set dependencies based on installed packages. If the default theme is installed, it will be used. Otherwise, falls back to fluid_styled_content.

public getDefaultSiteSetDependencies() : array<string|int, string>
Tags
todo

Implement a proper mechanism to detect/register a "default theme" instead of hardcoding a package name. This could be a configuration option, a special composer type, or a registry where themes can register themselves as the default. For now, we check for the specific package name.

Return values
array<string|int, string>

Site set identifiers

hasDefaultTheme()

Check if the default theme is available.

public hasDefaultTheme() : bool
Return values
bool

initializeDefaultThemeContent()

public initializeDefaultThemeContent(string $pageId, mixed $contentId) : void
Parameters
$pageId : string
$contentId : mixed
Tags
todo

This is a hack to preselect the backend layout for the default theme and update the default content element. This is really ugly but the same like checking for the specific package name in getDefaultSiteSetDependencies(). We need a registry, which can be read by the service to determine the default theme and necessary post creation actions.

setInstallToolPassword()

public setInstallToolPassword(string $password) : bool
Parameters
$password : string
Return values
bool

setSiteName()

public setSiteName(string $name) : bool
Parameters
$name : string
Return values
bool

writeSiteSetupTypoScript()

Writes a setup.typoscript file to the site configuration directory with basic PAGE rendering.

public writeSiteSetupTypoScript(string $siteIdentifier) : bool
Parameters
$siteIdentifier : string
Return values
bool

        
On this page

Search results