‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct (protected TypoScriptService $typoScriptService, protected FlexFormService $flexFormService, protected PageRepository $pageRepository, protected EventDispatcher $eventDispatcher)
 
 setRequest (ServerRequestInterface $request)
 
 setConfiguration (array $configuration=[])
 
array getConfiguration (?string $extensionName=null, ?string $pluginName=null)
 
 getTypoScriptSetup ()
 

Protected Member Functions

 getExtbaseConfiguration ()
 
 getPluginConfiguration (string $extensionName, ?string $pluginName=null)
 
 getControllerConfiguration (string $extensionName, string $pluginName)
 
array getContextSpecificFrameworkConfiguration (array $frameworkConfiguration)
 
array overrideStoragePidIfStartingPointIsSet (array $frameworkConfiguration)
 
array overrideConfigurationFromPlugin (array $frameworkConfiguration)
 
array overrideConfigurationFromFlexForm (array $frameworkConfiguration)
 
array mergeConfigurationIntoFrameworkConfiguration (array $frameworkConfiguration, array $configuration, string $configurationPartName)
 
int[] getRecursiveStoragePids (array $storagePids, int $recursionDepth=0)
 
 removeIgnoredFlexFormSettingsIfEmpty (array $flexFormConfiguration, array $ignoredSettings)
 

Protected Attributes

array $configuration = array( )
 
string $extensionName
 
string $pluginName
 
array $configurationCache = array( )
 

Private Attributes

ServerRequestInterface $request = null
 

Detailed Description

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.

Definition at line 37 of file FrontendConfigurationManager.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::__construct ( protected TypoScriptService  $typoScriptService,
protected FlexFormService  $flexFormService,
protected PageRepository  $pageRepository,
protected EventDispatcher  $eventDispatcher 
)

Definition at line 68 of file FrontendConfigurationManager.php.

Member Function Documentation

◆ getConfiguration()

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getConfiguration ( ?string  $extensionName = null,
?string  $pluginName = null 
)

Loads the Extbase Framework configuration.

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
string | null$extensionName‪if specified, the configuration for the given extension will be returned (plugin.tx_extensionname)
string | null$pluginName‪if specified, the configuration for the given plugin will be returned (plugin.tx_extensionname_pluginname)
Returns
‪array the Extbase framework configuration

Definition at line 105 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$extensionName, $GLOBALS, TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$pluginName, TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getContextSpecificFrameworkConfiguration(), TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getControllerConfiguration(), TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getExtbaseConfiguration(), TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getPluginConfiguration(), TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getRecursiveStoragePids(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationDoesNotOverrideConfigurationWithContextSpecificFrameworkConfigurationIfDifferentPluginIsSpecified(), TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationOverridesConfigurationWithContextSpecificFrameworkConfigurationIfNoPluginWasSpecified(), TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationOverridesConfigurationWithContextSpecificFrameworkConfigurationIfSpecifiedPluginIsTheCurrentPlugin(), TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationRecursivelyMergesCurrentPluginConfigurationWithFrameworkConfiguration(), TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationRecursivelyMergesPluginConfigurationOfSpecifiedPluginWithFrameworkConfiguration(), TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationRetrievesStoragePidIncludingGivenStoragePidWithRecursiveSetForMultipleStoragePid(), TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationRetrievesStoragePidIncludingGivenStoragePidWithRecursiveSetForSingleStoragePid(), and TYPO3\CMS\Extbase\Tests\Unit\Configuration\FrontendConfigurationManagerTest\getConfigurationStoresResultInConfigurationCache().

◆ getContextSpecificFrameworkConfiguration()

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getContextSpecificFrameworkConfiguration ( array  $frameworkConfiguration)
protected

Get context specific framework configuration.

  • ‪Overrides storage PID with setting "Startingpoint"
  • ‪merge flexForm configuration, if needed
Parameters
array$frameworkConfiguration‪The framework configuration to modify
Returns
‪array the modified framework configuration

Definition at line 232 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\overrideConfigurationFromFlexForm(), TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\overrideConfigurationFromPlugin(), and TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\overrideStoragePidIfStartingPointIsSet().

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getConfiguration().

◆ getControllerConfiguration()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getControllerConfiguration ( string  $extensionName,
string  $pluginName 
)
protected

Returns the configured controller/action configuration of the specified plugin in the format array( 'Controller1' => array('action1', 'action2'), 'Controller2' => array('action3', 'action4') )

Parameters
string$pluginName‪in FE mode this is the specified plugin name

Definition at line 215 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$extensionName, $GLOBALS, and TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$pluginName.

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getConfiguration().

◆ getExtbaseConfiguration()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getExtbaseConfiguration ( )
protected

◆ getPluginConfiguration()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getPluginConfiguration ( string  $extensionName,
?string  $pluginName = null 
)
protected

Returns the TypoScript configuration found in plugin.tx_yourextension_yourplugin merged with the global configuration of your extension from plugin.tx_yourextension

Parameters
string | null$pluginName‪in FE mode this is the specified plugin name

Definition at line 187 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$extensionName, TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$pluginName, and TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getTypoScriptSetup().

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getConfiguration().

◆ getRecursiveStoragePids()

int [] TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getRecursiveStoragePids ( array  $storagePids,
int  $recursionDepth = 0 
)
protected

Returns a comma separated list of storagePid that are below a certain storage pid.

Parameters
array | int[]$storagePids‪Storage PIDs to start at; multiple PIDs possible as comma-separated list
int$recursionDepth‪Maximum number of levels to search, 0 to disable recursive lookup
Returns
‪int[] storage PIDs

Definition at line 359 of file FrontendConfigurationManager.php.

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getConfiguration().

◆ getTypoScriptSetup()

◆ mergeConfigurationIntoFrameworkConfiguration()

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::mergeConfigurationIntoFrameworkConfiguration ( array  $frameworkConfiguration,
array  $configuration,
string  $configurationPartName 
)
protected

Merge a configuration into the framework configuration.

Parameters
array$frameworkConfiguration‪the framework configuration to merge the data on
array$configuration‪The configuration
string$configurationPartName‪The name of the configuration part which should be merged.
Returns
‪array the processed framework configuration

Definition at line 340 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$configuration.

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\overrideConfigurationFromFlexForm(), and TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\overrideConfigurationFromPlugin().

◆ overrideConfigurationFromFlexForm()

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::overrideConfigurationFromFlexForm ( array  $frameworkConfiguration)
protected

Overrides configuration settings from flexForms. This merges the whole flexForm data.

Parameters
array$frameworkConfiguration‪the framework configuration
Returns
‪array the framework configuration with overridden data from flexForm

Definition at line 295 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\mergeConfigurationIntoFrameworkConfiguration(), TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\removeIgnoredFlexFormSettingsIfEmpty(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getContextSpecificFrameworkConfiguration().

◆ overrideConfigurationFromPlugin()

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::overrideConfigurationFromPlugin ( array  $frameworkConfiguration)
protected

Overrides configuration settings from the plugin typoscript (plugin.tx_myext_pi1.)

Parameters
array$frameworkConfiguration‪the framework configuration
Returns
‪array the framework configuration with overridden data from typoscript

Definition at line 271 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getTypoScriptSetup(), and TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\mergeConfigurationIntoFrameworkConfiguration().

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getContextSpecificFrameworkConfiguration().

◆ overrideStoragePidIfStartingPointIsSet()

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::overrideStoragePidIfStartingPointIsSet ( array  $frameworkConfiguration)
protected

Overrides the storage PID settings, in case the "Startingpoint" settings is set in the plugin configuration.

Parameters
array$frameworkConfiguration‪the framework configurations
Returns
‪array the framework configuration with overridden storagePid

Definition at line 247 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\getContextSpecificFrameworkConfiguration().

◆ removeIgnoredFlexFormSettingsIfEmpty()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::removeIgnoredFlexFormSettingsIfEmpty ( array  $flexFormConfiguration,
array  $ignoredSettings 
)
protected

◆ setConfiguration()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::setConfiguration ( array  $configuration = [])

Sets the specified raw configuration coming from the outside. Note that this is a low level method and only makes sense to be used by Extbase internally.

Parameters
array$configuration‪The new configuration

Definition at line 86 of file FrontendConfigurationManager.php.

References TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager\$configuration.

◆ setRequest()

TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::setRequest ( ServerRequestInterface  $request)

Member Data Documentation

◆ $configuration

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::$configuration = array( )
protected

◆ $configurationCache

array TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::$configurationCache = array( )
protected

1st level configuration cache

Definition at line 61 of file FrontendConfigurationManager.php.

◆ $extensionName

string TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::$extensionName
protected

◆ $pluginName

◆ $request

ServerRequestInterface TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::$request = null
private