SiteWriter

Writes Site objects into site configuration files.

Internal

Table of Contents

Properties

$configPath  : string
$eventDispatcher  : EventDispatcherInterface

Methods

__construct()  : mixed
createNewBasicSite()  : void
Creates a site configuration with one language "English" which is the de-facto default language for TYPO3 in general.
delete()  : void
Removes the config.yaml file of a site configuration.
rename()  : void
Renames a site identifier (and moves the folder)
write()  : void
Add or update a site configuration
writeSettings()  : void
findModified()  : array<string|int, mixed>
findRemoved()  : array<string|int, mixed>
protectPlaceholders()  : array<string, mixed>
Detects placeholders that have been introduced and handles* them.
sortConfiguration()  : array<string|int, mixed>

Properties

$configPath read-only

protected string $configPath

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

Methods

__construct()

public __construct(string $configPath, EventDispatcherInterface $eventDispatcher, YamlFileLoader $yamlFileLoader) : mixed
Parameters
$configPath : string
$eventDispatcher : EventDispatcherInterface
$yamlFileLoader : YamlFileLoader

createNewBasicSite()

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

public createNewBasicSite(string $identifier, int $rootPageId, string $base) : void
Parameters
$identifier : string
$rootPageId : int
$base : string
Tags
throws
SiteConfigurationWriteException

rename()

Renames a site identifier (and moves the folder)

public rename(string $currentIdentifier, string $newIdentifier) : void
Parameters
$currentIdentifier : string
$newIdentifier : string
Tags
throws
SiteConfigurationWriteException

write()

Add or update a site configuration

public write(string $siteIdentifier, array<string|int, mixed> $configuration[, bool $protectPlaceholders = false ]) : void
Parameters
$siteIdentifier : string
$configuration : array<string|int, mixed>
$protectPlaceholders : bool = false

whether to disallow introducing new placeholders

Tags
todo

enforce $protectPlaceholders with TYPO3 v13.0

throws
SiteConfigurationWriteException

writeSettings()

public writeSettings(string $siteIdentifier, array<string|int, mixed> $settings) : void
Parameters
$siteIdentifier : string
$settings : array<string|int, mixed>

findModified()

protected static findModified(array<string|int, mixed> $currentConfiguration, array<string|int, mixed> $newConfiguration) : array<string|int, mixed>
Parameters
$currentConfiguration : array<string|int, mixed>
$newConfiguration : array<string|int, mixed>
Return values
array<string|int, mixed>

findRemoved()

protected static findRemoved(array<string|int, mixed> $currentConfiguration, array<string|int, mixed> $newConfiguration) : array<string|int, mixed>
Parameters
$currentConfiguration : array<string|int, mixed>
$newConfiguration : array<string|int, mixed>
Return values
array<string|int, mixed>

protectPlaceholders()

Detects placeholders that have been introduced and handles* them.

protected protectPlaceholders(array<string, mixed> $existingConfiguration, array<string, mixed> $modifiedConfiguration) : array<string, mixed>

(*) currently throws an exception, but could be purged or escaped as well

Parameters
$existingConfiguration : array<string, mixed>
$modifiedConfiguration : array<string, mixed>
Tags
throws
SiteConfigurationWriteException
Return values
array<string, mixed>

sanitized configuration (currently not used, exception thrown before)

sortConfiguration()

protected sortConfiguration(array<string|int, mixed> $newConfiguration) : array<string|int, mixed>
Parameters
$newConfiguration : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results