BackendConfigurationManager

class \TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager

Extends
AbstractConfigurationManager

A general purpose configuration manager used in backend mode.

Table of Contents

Constants

DEFAULT_BACKEND_STORAGE_PID  : mixed = 0
Default backend storage PID

Properties

$configuration  : array
Storage of the raw TypoScript configuration
$configurationCache  : array
1st level configuration cache
$contentObject  : ContentObjectRenderer
$currentPageId  : int
stores the current page ID
$extensionName  : string
name of the extension this Configuration Manager instance belongs to
$pluginName  : string
name of the plugin this Configuration Manager instance belongs to
$typoScriptService  : TypoScriptService
$typoScriptSetupCache  : array

Methods

__construct()  : mixed
getConfiguration()  : array
Loads the Extbase Framework configuration.
getContentObject()  : ContentObjectRenderer
getDefaultBackendStoragePid()  : int
Returns the default backend storage pid
getTypoScriptSetup()  : array
Returns TypoScript Setup array from current Environment.
setConfiguration()  : void
Sets the specified raw configuration coming from the outside.
setContentObject()  : void
getBackendUser()  : BackendUserAuthentication
getContextSpecificFrameworkConfiguration()  : array
We need to set some default request handler if the framework configuration could not be loaded; to make sure Extbase also works in Backend modules in all contexts.
getControllerConfiguration()  : array
Returns the configured controller/action configuration of the specified module in the format array( 'Controller1' => array('action1', 'action2'), 'Controller2' => array('action3', 'action4') )
getCurrentPageId()  : int
Returns the page uid of the current page.
getCurrentPageIdFromCurrentSiteRoot()  : int
Gets the current page ID from the first site root in tree.
getCurrentPageIdFromGetPostData()  : int
Gets the current page ID from the GET/POST data.
getCurrentPageIdFromRootTemplate()  : int
Gets the current page ID from the first created root template.
getExtbaseConfiguration()  : array
Returns the TypoScript configuration found in config.tx_extbase
getPageChildrenRecursive()  : int[]
Recursively fetch all children of a given page
getPluginConfiguration()  : array
Returns the TypoScript configuration found in module.tx_yourextension_yourmodule merged with the global configuration of your extension from module.tx_yourextension
getRecursiveStoragePids()  : int[]
Returns an array of storagePIDs that are below a list of storage pids.
overrideControllerConfigurationWithSwitchableControllerActions()  : void
This method possibly overrides the controller configuration with an alternative configuration passed along via $frameworkConfiguration.

Constants

DEFAULT_BACKEND_STORAGE_PID

Default backend storage PID

public mixed DEFAULT_BACKEND_STORAGE_PID = 0

Properties

$configuration

Storage of the raw TypoScript configuration

protected array $configuration = []

$configurationCache

1st level configuration cache

protected array $configurationCache = []

$currentPageId

stores the current page ID

protected int $currentPageId

$extensionName

name of the extension this Configuration Manager instance belongs to

protected string $extensionName

$pluginName

name of the plugin this Configuration Manager instance belongs to

protected string $pluginName

$typoScriptSetupCache

protected array $typoScriptSetupCache = []

Methods

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

Tags

todo:

This dependency to ContentObjectRenderer on a singleton object is unfortunate: The current instance is set through USER cObj and extbase Bootstrap, its null in Backend. This getter is misused to retrieve current ContentObjectRenderer state by some extensions (eg. ext:form). This dependency should be removed altogether. Although the current implementation always returns an instance of ContentObjectRenderer, we do not want to hard-expect consuming classes on that, since this methods needs to be dropped anyways, so potential null return is kept.

Return values

ContentObjectRenderer

getDefaultBackendStoragePid()

Returns the default backend storage pid

public getDefaultBackendStoragePid() : int

Return values

int

getTypoScriptSetup()

Returns TypoScript Setup array from current Environment.

public getTypoScriptSetup() : array

Return values

array —

the raw TypoScript setup

setConfiguration()

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

getContextSpecificFrameworkConfiguration()

We need to set some default request handler if the framework configuration could not be loaded; to make sure Extbase also works in Backend modules in all contexts.

protected getContextSpecificFrameworkConfiguration(array $frameworkConfiguration) : array

Parameters

$frameworkConfiguration : array

Return values

array

getControllerConfiguration()

Returns the configured controller/action configuration of the specified module 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 BE mode this is actually the module signature. But we're using it just like the plugin name in FE

Return values

array

getCurrentPageId()

Returns the page uid of the current page.

protected getCurrentPageId() : int

If no page is selected, we'll return the uid of the first root page.

Return values

int —

current page id. If no page is selected current root page id is returned

getCurrentPageIdFromCurrentSiteRoot()

Gets the current page ID from the first site root in tree.

protected getCurrentPageIdFromCurrentSiteRoot() : int

Return values

int —

the page UID, will be 0 if none has been set

getCurrentPageIdFromGetPostData()

Gets the current page ID from the GET/POST data.

protected getCurrentPageIdFromGetPostData() : int

Return values

int —

the page UID, will be 0 if none has been set

getCurrentPageIdFromRootTemplate()

Gets the current page ID from the first created root template.

protected getCurrentPageIdFromRootTemplate() : int

Return values

int —

the page UID, will be 0 if none has been set

getExtbaseConfiguration()

Returns the TypoScript configuration found in config.tx_extbase

protected getExtbaseConfiguration() : array

Return values

array

getPageChildrenRecursive()

Recursively fetch all children of a given page

protected getPageChildrenRecursive(int $pid, int $depth, int $begin, string $permsClause) : int[]

Parameters

$pid : int

uid of the page

$depth : int
$begin : int
$permsClause : string

Return values

int[] —

List of child row $uid's

getPluginConfiguration()

Returns the TypoScript configuration found in module.tx_yourextension_yourmodule merged with the global configuration of your extension from module.tx_yourextension

protected getPluginConfiguration(string $extensionName[, string $pluginName = null ]) : array

Parameters

$extensionName : string
$pluginName : string = null

in BE mode this is actually the module signature. But we're using it just like the plugin name in FE

Return values

array

getRecursiveStoragePids()

Returns an array of storagePIDs that are below a list of storage pids.

protected getRecursiveStoragePids(int[] $storagePids[, int $recursionDepth = 0 ]) : int[]

Parameters

$storagePids : 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[] —

Uid list including the start $storagePids

overrideControllerConfigurationWithSwitchableControllerActions()

This method possibly overrides the controller configuration with an alternative configuration passed along via $frameworkConfiguration.

protected overrideControllerConfigurationWithSwitchableControllerActions(array &$frameworkConfiguration, array $switchableControllerActions) : void

Deprecated

since TYPO3 v10, will be removed in one of the next major versions of TYPO3, probably version 11.0 or 12.0.

If called by \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager::getConfiguration, $switchableControllerActions may contain an alternative controller configuration defined via typoscript:

Example: tt_content.list.20.indexedsearch_pi2.switchableControllerActions { Search { 0 = search } }

If called by \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::overrideSwitchableControllerActionsFromFlexForm, $switchableControllerActions may contain an alternative controller configuration defined via plugin flexform.

Parameters

$frameworkConfiguration : array
$switchableControllerActions : array
On this page