SiteWriter

Writes Site objects into site configuration files.

Internal

Table of Contents

Properties

$cache  : PhpFrontend
$cacheIdentifier  : string
Identifier to store all configuration data in the core cache.
$configFileName  : string
Config yaml file name.
$configPath  : string
$eventDispatcher  : EventDispatcherInterface
$settingsFileName  : string
YAML file name with all settings.

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

$cacheIdentifier

Identifier to store all configuration data in the core cache.

protected string $cacheIdentifier = 'sites-configuration'
Internal

$configFileName

Config yaml file name.

protected string $configFileName = 'config.yaml'
Internal

$eventDispatcher

protected EventDispatcherInterface $eventDispatcher

$settingsFileName

YAML file name with all settings.

protected string $settingsFileName = 'settings.yaml'
Internal
Tags
todo

remove, move usages to SiteSettingsFactory

Methods

__construct()

public __construct(string $configPath, EventDispatcherInterface $eventDispatcher, PhpFrontend $cache) : mixed
Parameters
$configPath : string
$eventDispatcher : EventDispatcherInterface
$cache : PhpFrontend

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