SiteConfiguration
Responsibility: Handles the format of the configuration (currently yaml), and the location of the file system folder
Reads all available site configuration options, and puts them into Site objects.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $cache : PhpFrontend
- $configPath : string
- $eventDispatcher : EventDispatcherInterface
- $runtimeCache : FrontendInterface
- $setRegistry : SetRegistry
- $siteSettingsFactory : SiteSettingsFactory
Methods
- __construct() : mixed
- getAllExistingSites() : array<string|int, Site>
- Return all site objects which have been found in the filesystem.
- getAllSiteConfigurationPaths() : array<string|int, mixed>
- Returns an array of paths in which a site configuration is found.
- load() : array<string|int, mixed>
- Load plain configuration without additional settings.
- resolveAllExistingSites() : array<string|int, Site>
- Resolve all site objects which have been found in the filesystem.
- resolveAllExistingSitesRaw() : array<string|int, Site>
- Resolve all site objects which have been found in the filesystem containing settings only from the `config.yaml` file ignoring values from the `settings.yaml` and `csp.yaml` file.
- siteConfigurationChanged() : void
- warmupCaches() : void
- determineInvalidSets() : array<string|int, mixed>
- getAllResolvedSiteData() : array<string|int, mixed>
- Assemble all data needed to create Site objects: the site configuration enriched with route enhancers and settings from site sets, settings objects, TypoScript and TSconfig read from the file system. This data is cached in the core cache, to avoid set resolution, settings composition and file system access per request.
- getAllSiteConfigurationFromFiles() : array<string|int, mixed>
- Read the site configuration from config files.
- getContentSecurityPolicies() : array<string|int, mixed>
- getRouteEnhancersFromSets() : array<string|int, mixed>
- Get route enhancers from site sets.
- getSiteTSconfig() : SiteTSconfig|null
- getSiteTypoScript() : SiteTypoScript|null
- writeCache() : void
- Persist the raw site configuration and - if available - the resolved site data in one core cache entry, to keep both in sync at all times.
Properties
$cache
protected
PhpFrontend
$cache
Attributes
- #[Autowire]
- $service: 'cache.core'
$configPath
protected
string
$configPath
Attributes
- #[Autowire]
- '%env(TYPO3:configPath)%/sites'
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$runtimeCache read-only
protected
FrontendInterface
$runtimeCache
Attributes
- #[Autowire]
- $service: 'cache.runtime'
$setRegistry
protected
SetRegistry
$setRegistry
$siteSettingsFactory
protected
SiteSettingsFactory
$siteSettingsFactory
Methods
__construct()
public
__construct(string $configPath, SiteSettingsFactory $siteSettingsFactory, SetRegistry $setRegistry, EventDispatcherInterface $eventDispatcher, PhpFrontend $cache, YamlFileLoader $yamlFileLoader, FrontendInterface $runtimeCache) : mixed
Parameters
- $configPath : string
- $siteSettingsFactory : SiteSettingsFactory
- $setRegistry : SetRegistry
- $eventDispatcher : EventDispatcherInterface
- $cache : PhpFrontend
- $yamlFileLoader : YamlFileLoader
- $runtimeCache : FrontendInterface
getAllExistingSites()
Return all site objects which have been found in the filesystem.
public
getAllExistingSites([bool $useCache = true ]) : array<string|int, Site>
Parameters
- $useCache : bool = true
Return values
array<string|int, Site>getAllSiteConfigurationPaths()
Returns an array of paths in which a site configuration is found.
public
getAllSiteConfigurationPaths() : array<string|int, mixed>
Return values
array<string|int, mixed>load()
Load plain configuration without additional settings.
public
load(string $siteIdentifier) : array<string|int, mixed>
This method should only be used in case the original configuration as it exists in the file should be loaded, for example for writing / editing configuration.
All read related actions should be performed on the site entity.
Parameters
- $siteIdentifier : string
Return values
array<string|int, mixed>resolveAllExistingSites()
Resolve all site objects which have been found in the filesystem.
public
resolveAllExistingSites([bool $useCache = true ]) : array<string|int, Site>
Parameters
- $useCache : bool = true
Return values
array<string|int, Site>resolveAllExistingSitesRaw()
Resolve all site objects which have been found in the filesystem containing settings only from the `config.yaml` file ignoring values from the `settings.yaml` and `csp.yaml` file.
public
resolveAllExistingSitesRaw() : array<string|int, Site>
Not part of public API. Used as intermediate solution until settings are handled by a dedicated GUI.
Return values
array<string|int, Site>siteConfigurationChanged()
public
siteConfigurationChanged() : void
Attributes
- #[AsEventListener]
- $event: SiteConfigurationChangedEvent::class
warmupCaches()
public
warmupCaches(CacheWarmupEvent $event) : void
Parameters
- $event : CacheWarmupEvent
Attributes
- #[AsEventListener]
- 'typo3-core/site-configuration'
determineInvalidSets()
protected
determineInvalidSets(string $siteIdentifier, array<string|int, mixed> $sets) : array<string|int, mixed>
Parameters
- $siteIdentifier : string
- $sets : array<string|int, mixed>
Return values
array<string|int, mixed>getAllResolvedSiteData()
Assemble all data needed to create Site objects: the site configuration enriched with route enhancers and settings from site sets, settings objects, TypoScript and TSconfig read from the file system. This data is cached in the core cache, to avoid set resolution, settings composition and file system access per request.
protected
getAllResolvedSiteData(bool $useCache) : array<string|int, mixed>
Parameters
- $useCache : bool
Return values
array<string|int, mixed>getAllSiteConfigurationFromFiles()
Read the site configuration from config files.
protected
getAllSiteConfigurationFromFiles([bool $useCache = true ]) : array<string|int, mixed>
Parameters
- $useCache : bool = true
Tags
Return values
array<string|int, mixed>getContentSecurityPolicies()
protected
getContentSecurityPolicies(string $siteIdentifier) : array<string|int, mixed>
Parameters
- $siteIdentifier : string
Return values
array<string|int, mixed>getRouteEnhancersFromSets()
Get route enhancers from site sets.
protected
getRouteEnhancersFromSets(array<string|int, mixed> $dependencies) : array<string|int, mixed>
Parameters
- $dependencies : array<string|int, mixed>
Return values
array<string|int, mixed>getSiteTSconfig()
protected
getSiteTSconfig(string $siteIdentifier) : SiteTSconfig|null
Parameters
- $siteIdentifier : string
Return values
SiteTSconfig|nullgetSiteTypoScript()
protected
getSiteTypoScript(string $siteIdentifier) : SiteTypoScript|null
Parameters
- $siteIdentifier : string
Return values
SiteTypoScript|nullwriteCache()
Persist the raw site configuration and - if available - the resolved site data in one core cache entry, to keep both in sync at all times.
protected
writeCache(array<string|int, mixed> $siteConfiguration, array<string|int, mixed>|null $resolvedData) : void
Parameters
- $siteConfiguration : array<string|int, mixed>
- $resolvedData : array<string|int, mixed>|null