‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Site\SiteSettingsFactory Class Reference

Public Member Functions

 __construct (#[Autowire('%env(TYPO3:configPath)%/sites')] protected string $configPath, protected SetRegistry $setRegistry, protected SettingsTypeRegistry $settingsTypeRegistry, protected YamlFileLoader $yamlFileLoader, #[Autowire(service:'cache.core')] protected readonly PhpFrontend $cache, #[Autowire(expression:'service("package-dependent-cache-identifier").withPrefix("SiteSettings")')] protected PackageDependentCacheIdentifier $cacheIdentifier, protected string $settingsFileName='settings.yaml',)
 
 getSettings (string $siteIdentifier, array $siteConfiguration)
 
 createSettings (string $siteIdentifier, array $siteConfiguration)
 

Protected Member Functions

 validateSettings (array $settings, array $definitions)
 

Detailed Description

Definition at line 33 of file SiteSettingsFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Site\SiteSettingsFactory::__construct ( # protected string  $configPath[Autowire('%env(TYPO3:configPath)%/sites')],
protected SetRegistry  $setRegistry,
protected SettingsTypeRegistry  $settingsTypeRegistry,
protected YamlFileLoader  $yamlFileLoader,
# protected readonly PhpFrontend  $cache[Autowire(service:'cache.core')],
# protected PackageDependentCacheIdentifier  $cacheIdentifier[Autowire(expression:'service("package-dependent-cache-identifier").withPrefix("SiteSettings")')],
protected string  $settingsFileName = 'settings.yaml' 
)

Definition at line 35 of file SiteSettingsFactory.php.

Member Function Documentation

◆ createSettings()

TYPO3\CMS\Core\Site\SiteSettingsFactory::createSettings ( string  $siteIdentifier,
array  $siteConfiguration 
)

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

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.

Definition at line 76 of file SiteSettingsFactory.php.

References TYPO3\CMS\Webhooks\Message\$siteIdentifier, TYPO3\CMS\Core\Utility\ArrayUtility\setValueByPath(), and TYPO3\CMS\Core\Site\SiteSettingsFactory\validateSettings().

Referenced by TYPO3\CMS\Core\Site\SiteSettingsFactory\getSettings().

◆ getSettings()

TYPO3\CMS\Core\Site\SiteSettingsFactory::getSettings ( string  $siteIdentifier,
array  $siteConfiguration 
)

◆ validateSettings()

TYPO3\CMS\Core\Site\SiteSettingsFactory::validateSettings ( array  $settings,
array  $definitions 
)
protected