SiteSettingsFactory

readonly class \TYPO3\CMS\Core\Site\SiteSettingsFactory

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Properties

$cache  : PhpFrontend
$cacheIdentifier  : PackageDependentCacheIdentifier
$configPath  : string
$setRegistry  : SetRegistry
$settingsFactory  : SettingsFactory
$settingsFileName  : string
$settingsTypeRegistry  : SettingsTypeRegistry
$yamlFileLoader  : YamlFileLoader

Methods

__construct()  : mixed
composeSettings()  : SiteSettings
createSettings()  : SiteSettings
Fetch the settings for a specific site and return the parsed Site Settings object.
getSettings()  : SiteSettings
loadLocalSettings()  : array|null
Load settings from config/sites/{$siteIdentifier}/settings.yaml.
getSettingsProviders()  : SiteSettingsProvider[]

Properties

$configPath

protected string $configPath

Attributes

#[Autowire]
'%env(TYPO3:configPath)%/sites'

$settingsFileName

protected string $settingsFileName = 'settings.yaml'

Methods

__construct()

public __construct(string $configPath, SetRegistry $setRegistry, SettingsTypeRegistry $settingsTypeRegistry, SettingsFactory $settingsFactory, YamlFileLoader $yamlFileLoader, PhpFrontend $cache, PackageDependentCacheIdentifier $cacheIdentifier[, string $settingsFileName = 'settings.yaml' ]) : mixed

Parameters

$configPath : string
$setRegistry : SetRegistry
$settingsTypeRegistry : SettingsTypeRegistry
$settingsFactory : SettingsFactory
$yamlFileLoader : YamlFileLoader
$cache : PhpFrontend
$cacheIdentifier : PackageDependentCacheIdentifier
$settingsFileName : string = 'settings.yaml'

composeSettings()

public composeSettings(array $rawSettings, array $sets) : SiteSettings

Parameters

$rawSettings : array
$sets : array

Return values

SiteSettings

createSettings()

Fetch the settings for a specific site and return the parsed Site Settings object.

public createSettings([array $sets = [] ][, string|null $siteIdentifier = null ][, array $inlineSettings = [] ]) : SiteSettings

Parameters

$sets : array = []
$siteIdentifier : string|null = null
$inlineSettings : array = []

Tags

todo

This method resolves placeholders during the loading, which is okay as this is only used in context where the replacement is needed. However, this may change in the future, for example if loading is needed for implementing a GUI for the settings - which should either get a dedicated method or a flag to control if placeholder should be resolved during yaml file loading or not. The SiteConfiguration save action currently avoid calling this method.

Return values

SiteSettings

getSettings()

public getSettings(string $siteIdentifier, array $siteConfiguration) : SiteSettings

Parameters

$siteIdentifier : string
$siteConfiguration : array

Return values

SiteSettings

loadLocalSettings()

Load settings from config/sites/{$siteIdentifier}/settings.yaml.

public loadLocalSettings(string $siteIdentifier) : array|null

Parameters

$siteIdentifier : string

Return values

array|null
On this page