FrontendConfigurationManager
class \
- Implements
- SingletonInterface
A general purpose configuration manager used in frontend mode.
Should NOT be singleton, as a new configuration manager is needed per plugin.
Internal
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
- Storage of the raw TypoScript configuration
- $configurationCache : array
- 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
- Loads the Extbase Framework configuration.
- getContentObject() : ContentObjectRenderer|null
- getTypoScriptSetup() : array
- 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
- Get context specific framework configuration.
- getControllerConfiguration() : array
- Returns the configured controller/action configuration of the specified plugin in the format array( 'Controller1' => array('action1', 'action2'), 'Controller2' => array('action3', 'action4') )
- getExtbaseConfiguration() : array
- Returns the TypoScript configuration found in config.tx_extbase
- getPluginConfiguration() : array
- Returns the TypoScript configuration found in plugin.tx_yourextension_yourplugin merged with the global configuration of your extension from plugin.tx_yourextension
- getRecursiveStoragePids() : int[]
- Returns a comma separated list of storagePid that are below a certain storage pid.
- mergeConfigurationIntoFrameworkConfiguration() : array
- Merge a configuration into the framework configuration.
- overrideConfigurationFromFlexForm() : array
- Overrides configuration settings from flexForms. This merges the whole flexForm data.
- overrideConfigurationFromPlugin() : array
- Overrides configuration settings from the plugin typoscript (plugin.tx_myext_pi1.)
- overrideStoragePidIfStartingPointIsSet() : array
- Overrides the storage PID settings, in case the "Startingpoint" settings is set in the plugin configuration.
- removeIgnoredFlexFormSettingsIfEmpty() : array
Properties
$configuration
Storage of the raw TypoScript configuration
protected
array
$configuration
= []
$configurationCache
1st level configuration cache
protected
array
$configurationCache
= []
$contentObject
Deprecated
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
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 —the Extbase framework configuration
getContentObject()
public
getContentObject() : ContentObjectRenderer|null
Deprecated
since v12. Remove in v13.
Return values
ContentObjectRenderer|nullgetTypoScriptSetup()
Returns full Frontend TypoScript setup array calculated by FE middlewares.
public
getTypoScriptSetup() : array
Return values
arraysetConfiguration()
Sets the specified raw configuration coming from the outside.
public
setConfiguration([array $configuration = [] ]) : void
Note that this is a low level method and only makes sense to be used by Extbase internally.
Parameters
- $configuration : array = []
-
The new configuration
setContentObject()
public
setContentObject(ContentObjectRenderer $contentObject) : void
Deprecated
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 $frameworkConfiguration) : array
- Overrides storage PID with setting "Startingpoint"
- merge flexForm configuration, if needed
Parameters
- $frameworkConfiguration : array
-
The framework configuration to modify
Return values
array —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
Parameters
- $extensionName : string
- $pluginName : string
-
in FE mode this is the specified plugin name
Return values
arraygetExtbaseConfiguration()
Returns the TypoScript configuration found in config.tx_extbase
protected
getExtbaseConfiguration() : array
Return values
arraygetPluginConfiguration()
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
Parameters
- $extensionName : string
- $pluginName : string|null = null
-
in FE mode this is the specified plugin name
Return values
arraygetRecursiveStoragePids()
Returns a comma separated list of storagePid that are below a certain storage pid.
protected
getRecursiveStoragePids(array|int[] $storagePids[, int $recursionDepth = 0 ]) : int[]
Parameters
- $storagePids : array|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
int[] —storage PIDs
mergeConfigurationIntoFrameworkConfiguration()
Merge a configuration into the framework configuration.
protected
mergeConfigurationIntoFrameworkConfiguration(array $frameworkConfiguration, array $configuration, string $configurationPartName) : array
Parameters
- $frameworkConfiguration : array
-
the framework configuration to merge the data on
- $configuration : array
-
The configuration
- $configurationPartName : string
-
The name of the configuration part which should be merged.
Return values
array —the processed framework configuration
overrideConfigurationFromFlexForm()
Overrides configuration settings from flexForms. This merges the whole flexForm data.
protected
overrideConfigurationFromFlexForm(array $frameworkConfiguration) : array
Parameters
- $frameworkConfiguration : array
-
the framework configuration
Return values
array —the framework configuration with overridden data from flexForm
overrideConfigurationFromPlugin()
Overrides configuration settings from the plugin typoscript (plugin.tx_myext_pi1.)
protected
overrideConfigurationFromPlugin(array $frameworkConfiguration) : array
Parameters
- $frameworkConfiguration : array
-
the framework configuration
Return values
array —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 $frameworkConfiguration) : array
Parameters
- $frameworkConfiguration : array
-
the framework configurations
Return values
array —the framework configuration with overridden storagePid
removeIgnoredFlexFormSettingsIfEmpty()
protected
removeIgnoredFlexFormSettingsIfEmpty(array $flexFormConfiguration, array $ignoredSettings) : array
Parameters
- $flexFormConfiguration : array
- $ignoredSettings : array