FrontendConfigurationManager implements SingletonInterface
A general purpose configuration manager used in frontend mode.
Should NOT be singleton, as a new configuration manager is needed per plugin.
only to be used within Extbase, not part of TYPO3 Core API.
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $configuration : array<string|int, mixed>
- Storage of the raw TypoScript configuration
- $configurationCache : array<string|int, mixed>
- 1st level configuration cache
- $contentObject : ContentObjectRenderer
- $eventDispatcher : EventDispatcher
- $extensionName : string
- name of the extension this Configuration Manager instance belongs to
- $flexFormService : FlexFormService
- $pageRepository : PageRepository
- $pluginName : string
- name of the plugin this Configuration Manager instance belongs to
- $typoScriptService : TypoScriptService
Methods
- __construct() : mixed
- getConfiguration() : array<string|int, mixed>
- Loads the Extbase Framework configuration.
- getContentObject() : ContentObjectRenderer|null
- getTypoScriptSetup() : array<string|int, mixed>
- Returns full Frontend TypoScript setup array calculated by FE middlewares.
- setConfiguration() : void
- Sets the specified raw configuration coming from the outside.
- setContentObject() : void
- setRequest() : void
- getContextSpecificFrameworkConfiguration() : array<string|int, mixed>
- Get context specific framework configuration.
- getControllerConfiguration() : array<string|int, mixed>
- Returns the configured controller/action configuration of the specified plugin in the format array( 'Controller1' => array('action1', 'action2'), 'Controller2' => array('action3', 'action4') )
- getExtbaseConfiguration() : array<string|int, mixed>
- Returns the TypoScript configuration found in config.tx_extbase
- getPluginConfiguration() : array<string|int, mixed>
- Returns the TypoScript configuration found in plugin.tx_yourextension_yourplugin merged with the global configuration of your extension from plugin.tx_yourextension
- getRecursiveStoragePids() : array<string|int, int>
- Returns a comma separated list of storagePid that are below a certain storage pid.
- mergeConfigurationIntoFrameworkConfiguration() : array<string|int, mixed>
- Merge a configuration into the framework configuration.
- overrideConfigurationFromFlexForm() : array<string|int, mixed>
- Overrides configuration settings from flexForms. This merges the whole flexForm data.
- overrideConfigurationFromPlugin() : array<string|int, mixed>
- Overrides configuration settings from the plugin typoscript (plugin.tx_myext_pi1.)
- overrideStoragePidIfStartingPointIsSet() : array<string|int, mixed>
- Overrides the storage PID settings, in case the "Startingpoint" settings is set in the plugin configuration.
- removeIgnoredFlexFormSettingsIfEmpty() : array<string|int, mixed>
Properties
$configuration
Storage of the raw TypoScript configuration
protected
array<string|int, mixed>
$configuration
= []
$configurationCache
1st level configuration cache
protected
array<string|int, mixed>
$configurationCache
= []
$contentObject
since v12. Remove in v13.
protected
ContentObjectRenderer
$contentObject
$eventDispatcher
protected
EventDispatcher
$eventDispatcher
$extensionName
name of the extension this Configuration Manager instance belongs to
protected
string
$extensionName
$flexFormService
protected
FlexFormService
$flexFormService
$pageRepository
protected
PageRepository
$pageRepository
$pluginName
name of the plugin this Configuration Manager instance belongs to
protected
string
$pluginName
$typoScriptService
protected
TypoScriptService
$typoScriptService
Methods
__construct()
public
__construct(TypoScriptService $typoScriptService, FlexFormService $flexFormService, PageRepository $pageRepository, EventDispatcher $eventDispatcher) : mixed
Parameters
- $typoScriptService : TypoScriptService
- $flexFormService : FlexFormService
- $pageRepository : PageRepository
- $eventDispatcher : EventDispatcher
getConfiguration()
Loads the Extbase Framework configuration.
public
getConfiguration([string|null $extensionName = null ][, string|null $pluginName = null ]) : array<string|int, mixed>
The Extbase framework configuration HAS TO be retrieved using this method, as they are come from different places than the normal settings. Framework configuration is, in contrast to normal settings, needed for the Extbase framework to operate correctly.
Parameters
- $extensionName : string|null = null
-
if specified, the configuration for the given extension will be returned (plugin.tx_extensionname)
- $pluginName : string|null = null
-
if specified, the configuration for the given plugin will be returned (plugin.tx_extensionname_pluginname)
Return values
array<string|int, mixed> —the Extbase framework configuration
getContentObject()
public
getContentObject() : ContentObjectRenderer|null
since v12. Remove in v13.
Return values
ContentObjectRenderer|nullgetTypoScriptSetup()
Returns full Frontend TypoScript setup array calculated by FE middlewares.
public
getTypoScriptSetup() : array<string|int, mixed>
Return values
array<string|int, mixed>setConfiguration()
Sets the specified raw configuration coming from the outside.
public
setConfiguration([array<string|int, mixed> $configuration = [] ]) : void
Note that this is a low level method and only makes sense to be used by Extbase internally.
Parameters
- $configuration : array<string|int, mixed> = []
-
The new configuration
setContentObject()
public
setContentObject(ContentObjectRenderer $contentObject) : void
since v12. Remove in v13.
Parameters
- $contentObject : ContentObjectRenderer
setRequest()
public
setRequest(ServerRequestInterface $request) : void
Parameters
- $request : ServerRequestInterface
getContextSpecificFrameworkConfiguration()
Get context specific framework configuration.
protected
getContextSpecificFrameworkConfiguration(array<string|int, mixed> $frameworkConfiguration) : array<string|int, mixed>
- Overrides storage PID with setting "Startingpoint"
- merge flexForm configuration, if needed
Parameters
- $frameworkConfiguration : array<string|int, mixed>
-
The framework configuration to modify
Return values
array<string|int, mixed> —the modified framework configuration
getControllerConfiguration()
Returns the configured controller/action configuration of the specified plugin in the format array( 'Controller1' => array('action1', 'action2'), 'Controller2' => array('action3', 'action4') )
protected
getControllerConfiguration(string $extensionName, string $pluginName) : array<string|int, mixed>
Parameters
- $extensionName : string
- $pluginName : string
-
in FE mode this is the specified plugin name
Return values
array<string|int, mixed>getExtbaseConfiguration()
Returns the TypoScript configuration found in config.tx_extbase
protected
getExtbaseConfiguration() : array<string|int, mixed>
Return values
array<string|int, mixed>getPluginConfiguration()
Returns the TypoScript configuration found in plugin.tx_yourextension_yourplugin merged with the global configuration of your extension from plugin.tx_yourextension
protected
getPluginConfiguration(string $extensionName[, string|null $pluginName = null ]) : array<string|int, mixed>
Parameters
- $extensionName : string
- $pluginName : string|null = null
-
in FE mode this is the specified plugin name
Return values
array<string|int, mixed>getRecursiveStoragePids()
Returns a comma separated list of storagePid that are below a certain storage pid.
protected
getRecursiveStoragePids(array<string|int, mixed>|array<string|int, int> $storagePids[, int $recursionDepth = 0 ]) : array<string|int, int>
Parameters
- $storagePids : array<string|int, mixed>|array<string|int, int>
-
Storage PIDs to start at; multiple PIDs possible as comma-separated list
- $recursionDepth : int = 0
-
Maximum number of levels to search, 0 to disable recursive lookup
Return values
array<string|int, int> —storage PIDs
mergeConfigurationIntoFrameworkConfiguration()
Merge a configuration into the framework configuration.
protected
mergeConfigurationIntoFrameworkConfiguration(array<string|int, mixed> $frameworkConfiguration, array<string|int, mixed> $configuration, string $configurationPartName) : array<string|int, mixed>
Parameters
- $frameworkConfiguration : array<string|int, mixed>
-
the framework configuration to merge the data on
- $configuration : array<string|int, mixed>
-
The configuration
- $configurationPartName : string
-
The name of the configuration part which should be merged.
Return values
array<string|int, mixed> —the processed framework configuration
overrideConfigurationFromFlexForm()
Overrides configuration settings from flexForms. This merges the whole flexForm data.
protected
overrideConfigurationFromFlexForm(array<string|int, mixed> $frameworkConfiguration) : array<string|int, mixed>
Parameters
- $frameworkConfiguration : array<string|int, mixed>
-
the framework configuration
Return values
array<string|int, mixed> —the framework configuration with overridden data from flexForm
overrideConfigurationFromPlugin()
Overrides configuration settings from the plugin typoscript (plugin.tx_myext_pi1.)
protected
overrideConfigurationFromPlugin(array<string|int, mixed> $frameworkConfiguration) : array<string|int, mixed>
Parameters
- $frameworkConfiguration : array<string|int, mixed>
-
the framework configuration
Return values
array<string|int, mixed> —the framework configuration with overridden data from typoscript
overrideStoragePidIfStartingPointIsSet()
Overrides the storage PID settings, in case the "Startingpoint" settings is set in the plugin configuration.
protected
overrideStoragePidIfStartingPointIsSet(array<string|int, mixed> $frameworkConfiguration) : array<string|int, mixed>
Parameters
- $frameworkConfiguration : array<string|int, mixed>
-
the framework configurations
Return values
array<string|int, mixed> —the framework configuration with overridden storagePid
removeIgnoredFlexFormSettingsIfEmpty()
protected
removeIgnoredFlexFormSettingsIfEmpty(array<string|int, mixed> $flexFormConfiguration, array<string|int, mixed> $ignoredSettings) : array<string|int, mixed>
Parameters
- $flexFormConfiguration : array<string|int, mixed>
- $ignoredSettings : array<string|int, mixed>