ExtensionManagementUtility

Extension Management functions

This class is never instantiated, rather the methods inside is called as functions like \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('my_extension');

Table of Contents

Properties

$cacheManager  : CacheManager
$eventDispatcher  : EventDispatcherInterface
$extTablesWasReadFromCacheOnce  : bool
TRUE, if ext_tables file was read from cache for this script run.
$packageManager  : PackageManager

Methods

addCoreNavigationComponent()  : mixed
Registers a core navigation component
addFieldsToAllPalettesOfField()  : mixed
Adds new fields to all palettes that is defined after an existing field.
addFieldsToPalette()  : mixed
Adds new fields to a palette.
addFieldsToUserSettings()  : mixed
Adds a list of new fields to the TYPO3 USER SETTINGS configuration "showitem" list, the array with the new fields itself needs to be added additionally to show up in the user setup, like $GLOBALS['TYPO3_USER_SETTINGS']['columns'] += $tempColumns
addLLrefForTCAdescr()  : mixed
Adds a reference to a locallang file with $GLOBALS['TCA_DESCR'] labels FOR USE IN ext_tables.php FILES eg. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('pages', 'EXT:core/Resources/Private/Language/locallang_csh_pages.xlf'); for the pages table or \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_layout', 'EXT:frontend/Resources/Private/Language/locallang_csh_weblayout.xlf'); for the Web > Page module.
addModule()  : mixed
Adds a module (main or sub) to the backend interface FOR USE IN ext_tables.php FILES
addNavigationComponent()  : mixed
Registers a navigation component e.g. page tree
addPageTSConfig()  : mixed
Adds $content to the default Page TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultPageTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILE
addPiFlexFormValue()  : mixed
Adds an entry to the "ds" array of the tt_content field "pi_flexform".
addPItoST43()  : mixed
Add PlugIn to the default template rendering (previously called "Static Template #43")
addPlugin()  : mixed
Adds an entry to the list of plugins in content elements of type "Insert plugin" Takes the $itemArray (label, value[,icon]) and adds to the items-array of $GLOBALS['TCA'][tt_content] elements with CType "listtype" (or another field if $type points to another fieldname) If the value (array pos. 1) is already found in that items-array, the entry is substituted, otherwise the input array is added to the bottom.
addService()  : mixed
Adds a service to the global services array
addStaticFile()  : mixed
Call this method to add an entry in the static template list found in sys_templates FOR USE IN Configuration/TCA/Overrides/sys_template.php Use in ext_tables.php may break the frontend.
addTCAcolumns()  : mixed
Adding fields to an existing table definition in $GLOBALS['TCA'] Adds an array with $GLOBALS['TCA'] column-configuration to the $GLOBALS['TCA']-entry for that table.
addTcaSelectItem()  : mixed
Add an item to a select field item list.
addTcaSelectItemGroup()  : void
Adds an item group to a TCA select field, allows to add a group so addTcaSelectItem() can add a groupId with a label and its position within other groups.
addToAllTCAtypes()  : mixed
Makes fields visible in the TCEforms, adding them to the end of (all) "types"-configurations
addToInsertRecords()  : mixed
Adds the $table tablename to the list of tables allowed to be includes by content element type "Insert records" By using $content_table and $content_field you can also use the function for other tables.
addTypoScript()  : mixed
Adds $content to the default TypoScript code for either setup or constants as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_*'] (Basically this function can do the same as addTypoScriptSetup and addTypoScriptConstants - just with a little more hazzle, but also with some more options!) FOR USE IN ext_localconf.php FILES Note: As of TYPO3 CMS 6.2, static template #43 (content: default) was replaced with "defaultContentRendering" which makes it possible that a first extension like fluid_styled_content registers a "contentRendering" template (= a template that defines default content rendering TypoScript) by adding itself to $TYPO3_CONF_VARS[FE][contentRenderingTemplates][] = 'myext/Configuration/TypoScript'.
addTypoScriptConstants()  : mixed
Adds $content to the default TypoScript constants code as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_constants'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILES
addTypoScriptSetup()  : mixed
Adds $content to the default TypoScript setup code as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_setup'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILES
addUserTSConfig()  : mixed
Adds $content to the default User TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultUserTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILE
allowTableOnStandardPages()  : mixed
Add tablename to default list of allowed tables on pages (in $PAGES_TYPES) Will add the $table to the list of tables allowed by default on pages as setup by $PAGES_TYPES['default']['allowedTables'] FOR USE IN ext_tables.php FILES
buildBaseTcaFromSingleFiles()  : mixed
Find all Configuration/TCA/* files of extensions and create base TCA from it.
createBaseTcaCacheFile()  : mixed
Cache base $GLOBALS['TCA'] to cache file to require the whole thing in one file for next access instead of cycling through all extensions again.
createExtLocalconfCacheEntry()  : mixed
Create cache entry for concatenated ext_localconf.php files
createExtTablesCacheEntry()  : mixed
Create concatenated ext_tables.php cache file
deactivateService()  : mixed
Deactivate a service
extPath()  : string
Returns the absolute path to the extension with extension key $key.
findService()  : mixed
Find the available service with highest priority
findServiceByKey()  : array<string|int, mixed>
Find a specific service identified by its key Note that this completely bypasses the notions of priority and quality
getCN()  : string
Returns the correct class name prefix for the extension key $key
getExtensionIcon()  : string
Find extension icon
getExtensionVersion()  : string
Retrieves the version of an installed extension.
getFileFieldTCAConfig()  : array<string|int, mixed>
Gets the TCA configuration for a field handling (FAL) files.
getLoadedExtensionListArray()  : array<string|int, mixed>
Gets an array of loaded extension keys
insertModuleFunction()  : mixed
Adds a "Function menu module" ('third level module') to an existing function menu of some other backend module.
isLoaded()  : bool
Returns TRUE if the extension with extension key $key is loaded.
isServiceAvailable()  : bool
Check if a given service is available, based on the executable files it depends on
loadBaseTca()  : mixed
Wrapper for buildBaseTcaFromSingleFiles handling caching.
loadExtension()  : mixed
Loads given extension
loadExtLocalconf()  : mixed
Execute all ext_localconf.php files of loaded extensions.
loadExtTables()  : mixed
Execute all ext_tables.php files of loaded extensions.
makeCategorizable()  : mixed
Makes a table categorizable by adding value into the category registry.
registerPageTSConfigFile()  : mixed
Call this method to add an entry in the pageTSconfig list found in pages FOR USE in Configuration/TCA/Overrides/pages.php
resolvePackagePath()  : string
Temporary helper method to resolve paths with the PackageManager, because it is statically injected to this class already. This method will be removed without substitution in TYPO3 12 once a proper resource API is introduced.
setEventDispatcher()  : mixed
Sets the event dispatcher to be available.
setPackageManager()  : mixed
Sets the package manager for all that backwards compatibility stuff, so it doesn't have to be fetched through the bootstrap.
unloadExtension()  : mixed
Unloads given extension
dispatchTcaIsBeingBuiltEvent()  : mixed
Triggers an event for manipulating the final TCA
executePositionedStringInsertion()  : string
Inserts as list of data into an existing list.
getBaseTcaCacheIdentifier()  : string
Cache identifier of base TCA cache entry.
getCacheManager()  : CacheManager
Getter for the cache manager
getExtLocalconfCacheIdentifier()  : string
Cache identifier of concatenated ext_localconf file
getExtTablesCacheIdentifier()  : string
Cache identifier for concatenated ext_tables.php files
loadSingleExtLocalconfFiles()  : mixed
Execute ext_localconf.php files from extensions
loadSingleExtTablesFiles()  : mixed
Load ext_tables.php as single files
removeDuplicatesForInsertion()  : string
Compares an existing list of items and a list of items to be inserted and returns a duplicate-free variant of that insertion list.

Properties

$eventDispatcher

protected static EventDispatcherInterface $eventDispatcher

$extTablesWasReadFromCacheOnce

TRUE, if ext_tables file was read from cache for this script run.

protected static bool $extTablesWasReadFromCacheOnce = false

The frontend tends to do that multiple times, but the caching framework does not allow this (via a require_once call). This variable is used to track the access to the cache file to read the single ext_tables.php if it was already read from cache

Tags
todo

See if we can get rid of the 'load multiple times' scenario in fe

Methods

addCoreNavigationComponent()

Registers a core navigation component

public static addCoreNavigationComponent(string $module, string $componentId) : mixed
Parameters
$module : string
$componentId : string

addFieldsToAllPalettesOfField()

Adds new fields to all palettes that is defined after an existing field.

public static addFieldsToAllPalettesOfField(string $table, string $field, string $addFields[, string $insertionPosition = '' ]) : mixed

If the field does not have a following palette yet, it's created automatically and gets called "generatedFor-$field". FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

See unit tests for more examples and edge cases.

Example:

'aTable' => array( 'types' => array( 'aType' => array( 'showitem' => 'aField, --palette--;;aPalette', ), ), 'palettes' => array( 'aPalette' => array( 'showitem' => 'fieldB, fieldC', ), ), ),

Calling addFieldsToAllPalettesOfField('aTable', 'aField', 'newA', 'before: fieldC') results in:

'aTable' => array( 'types' => array( 'aType' => array( 'showitem' => 'aField, --palette--;;aPalette', ), ), 'palettes' => array( 'aPalette' => array( 'showitem' => 'fieldB, newA, fieldC', ), ), ),

Parameters
$table : string

Name of the table

$field : string

Name of the field that has the palette to be extended

$addFields : string

List of fields to be added to the palette

$insertionPosition : string = ''

Insert fields before (default) or after one

addFieldsToPalette()

Adds new fields to a palette.

public static addFieldsToPalette(string $table, string $palette, string $addFields[, string $insertionPosition = '' ]) : mixed

If the palette does not exist yet, it's created automatically. FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

Parameters
$table : string

Name of the table

$palette : string

Name of the palette to be extended

$addFields : string

List of fields to be added to the palette

$insertionPosition : string = ''

Insert fields before (default) or after one

addFieldsToUserSettings()

Adds a list of new fields to the TYPO3 USER SETTINGS configuration "showitem" list, the array with the new fields itself needs to be added additionally to show up in the user setup, like $GLOBALS['TYPO3_USER_SETTINGS']['columns'] += $tempColumns

public static addFieldsToUserSettings(string $addFields[, string $insertionPosition = '' ]) : mixed
Parameters
$addFields : string

List of fields to be added to the user settings

$insertionPosition : string = ''

Insert fields before (default) or after one

addLLrefForTCAdescr()

Adds a reference to a locallang file with $GLOBALS['TCA_DESCR'] labels FOR USE IN ext_tables.php FILES eg. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('pages', 'EXT:core/Resources/Private/Language/locallang_csh_pages.xlf'); for the pages table or \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_layout', 'EXT:frontend/Resources/Private/Language/locallang_csh_weblayout.xlf'); for the Web > Page module.

public static addLLrefForTCAdescr(string $key, string $file) : mixed
Parameters
$key : string

Description key. Typically a database table (like "pages") but for applications can be other strings, but prefixed with "MOD")

$file : string

File reference to locallang file, eg. "EXT:core/Resources/Private/Language/locallang_csh_pages.xlf"

addModule()

Adds a module (main or sub) to the backend interface FOR USE IN ext_tables.php FILES

public static addModule(string $main[, string $sub = '' ][, string $position = '' ][, string $path = null ][, array<string|int, mixed> $moduleConfiguration = [] ]) : mixed
Parameters
$main : string

The main module key, $sub is the submodule key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there.

$sub : string = ''

The submodule key. If $sub is not set a blank $main module is created.

$position : string = ''

Can be used to set the position of the $sub module within the list of existing submodules for the main module. $position has this syntax: [cmd]:[submodule-key]. cmd can be "after", "before" or "top" (or blank which is default). If "after"/"before" then submodule will be inserted after/before the existing submodule with [submodule-key] if found. If not found, the bottom of list. If "top" the module is inserted in the top of the submodule list.

$path : string = null

The absolute path to the module. Was used prior to TYPO3 v8, use $moduleConfiguration[routeTarget] now

$moduleConfiguration : array<string|int, mixed> = []

additional configuration, previously put in "conf.php" of the module directory

addNavigationComponent()

Registers a navigation component e.g. page tree

public static addNavigationComponent(string $module, string $componentId, string $extensionKey) : mixed
Parameters
$module : string
$componentId : string

componentId is also a RequireJS module name e.g. 'TYPO3/CMS/MyExt/MyNavComponent'

$extensionKey : string
Tags
throws
RuntimeException

addPageTSConfig()

Adds $content to the default Page TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultPageTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILE

public static addPageTSConfig(string $content) : mixed
Parameters
$content : string

Page TSconfig content

addPiFlexFormValue()

Adds an entry to the "ds" array of the tt_content field "pi_flexform".

public static addPiFlexFormValue(string $piKeyToMatch, string $value[, string $CTypeToMatch = 'list' ]) : mixed

This is used by plugins to add a flexform XML reference / content for use when they are selected as plugin or content element. FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

Parameters
$piKeyToMatch : string

Plugin key as used in the list_type field. Use the asterisk * to match all list_type values.

$value : string

Either a reference to a flex-form XML file (eg. "FILE:EXT:newloginbox/flexform_ds.xml") or the XML directly.

$CTypeToMatch : string = 'list'

Value of tt_content.CType (Content Type) to match. The default is "list" which corresponds to the "Insert Plugin" content element. Use the asterisk * to match all CType values.

Tags
see
addPlugin()

addPItoST43()

Add PlugIn to the default template rendering (previously called "Static Template #43")

public static addPItoST43(string $key[, string $_ = '' ][, string $suffix = '' ][, string $type = 'list_type' ][, bool $cacheable = false ]) : mixed

When adding a frontend plugin you will have to add both an entry to the TCA definition of tt_content table AND to the TypoScript template which must initiate the rendering.

The naming of #43 has historic reason and is rooted inside code which is now put into a TER extension called "statictemplates". Since the static template with uid 43 is the "content.default" and practically always used for rendering the content elements it's very useful to have this function automatically adding the necessary TypoScript for calling your plugin. The logic is now generalized and called "defaultContentRendering", see addTypoScript() as well.

$type determines the type of frontend plugin:

  • list_type (default) - the good old "Insert plugin" entry
  • CType - a new content element type
  • header_layout - an additional header type (added to the selection of layout1-5)
  • includeLib - just includes the library for manual use somewhere in TypoScript. (Remember that your $type definition should correspond to the column/items array in $GLOBALS['TCA'][tt_content] where you added the selector item for the element! See addPlugin() function) FOR USE IN ext_localconf.php FILES
Parameters
$key : string

The extension key

$_ : string = ''

unused since TYPO3 CMS 8

$suffix : string = ''

Is used as a suffix of the class name (e.g. "_pi1")

$type : string = 'list_type'

See description above

$cacheable : bool = false

If $cached is set as USER content object (cObject) is created - otherwise a USER_INT object is created.

addPlugin()

Adds an entry to the list of plugins in content elements of type "Insert plugin" Takes the $itemArray (label, value[,icon]) and adds to the items-array of $GLOBALS['TCA'][tt_content] elements with CType "listtype" (or another field if $type points to another fieldname) If the value (array pos. 1) is already found in that items-array, the entry is substituted, otherwise the input array is added to the bottom.

public static addPlugin(array<string|int, mixed> $itemArray[, string $type = 'list_type' ][, string $extensionKey = null ]) : mixed

Use this function to add a frontend plugin to this list of plugin-types - or more generally use this function to add an entry to any selectorbox/radio-button set in the FormEngine

FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

Parameters
$itemArray : array<string|int, mixed>

Numerical array: [0] => Plugin label, [1] => Plugin identifier / plugin key, ideally prefixed with an extension-specific name (e.g. "events2_list"), [2] => Icon identifier or path to plugin icon, [3] => an optional "group" ID, falls back to "default"

$type : string = 'list_type'

Type (eg. "list_type") - basically a field from "tt_content" table

$extensionKey : string = null

The extension key

Tags
throws
RuntimeException

addService()

Adds a service to the global services array

public static addService(string $extKey, string $serviceType, string $serviceKey, array<string|int, mixed> $info) : mixed
Parameters
$extKey : string

Extension key

$serviceType : string

Service type, must not be prefixed "tx_" or "Tx_"

$serviceKey : string

Service key, must be prefixed "tx_", "Tx_" or "user_"

$info : array<string|int, mixed>

Service description array

addStaticFile()

Call this method to add an entry in the static template list found in sys_templates FOR USE IN Configuration/TCA/Overrides/sys_template.php Use in ext_tables.php may break the frontend.

public static addStaticFile(string $extKey, string $path, string $title) : mixed
Parameters
$extKey : string

Is of course the extension key

$path : string

Is the path where the template files (fixed names) include_static.txt, constants.txt, setup.txt, and include_static_file.txt is found (relative to extPath, eg. 'static/'). The file include_static_file.txt, allows you to include other static templates defined in files, from your static template, and thus corresponds to the field 'include_static_file' in the sys_template table. The syntax for this is a comma separated list of static templates to include, like: EXT:fluid_styled_content/Configuration/TypoScript/,EXT:da_newsletter_subscription/static/,EXT:cc_random_image/pi2/static/

$title : string

Is the title in the selector box.

Tags
throws
InvalidArgumentException
see
addTypoScript()

addTCAcolumns()

Adding fields to an existing table definition in $GLOBALS['TCA'] Adds an array with $GLOBALS['TCA'] column-configuration to the $GLOBALS['TCA']-entry for that table.

public static addTCAcolumns(string $table, array<string|int, mixed> $columnArray) : mixed

This function adds the configuration needed for rendering of the field in TCEFORMS - but it does NOT add the field names to the types lists! So to have the fields displayed you must also call fx. addToAllTCAtypes or manually add the fields to the types list. FOR USE IN files in Configuration/TCA/Overrides/*.php . Use in ext_tables.php FILES may break the frontend.

Parameters
$table : string

The table name of a table already present in $GLOBALS['TCA'] with a columns section

$columnArray : array<string|int, mixed>

The array with the additional columns (typical some fields an extension wants to add)

addTcaSelectItem()

Add an item to a select field item list.

public static addTcaSelectItem(string $table, string $field, array<string|int, mixed> $item[, string $relativeToField = '' ][, string $relativePosition = '' ]) : mixed

Warning: Do not use this method for radio or check types, especially not with $relativeToField and $relativePosition parameters. This would shift existing database data 'off by one'. FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

As an example, this can be used to add an item to tt_content CType select drop-down after the existing 'mailform' field with these parameters:

  • $table = 'tt_content'
  • $field = 'CType'
  • $item = array( 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.I.10', 'login', 'i/imagename.gif', ),
  • $relativeToField = mailform
  • $relativePosition = after

$item has an optional fourth parameter for the groupId (string), to attach the new item to. The groupname is defined when a group is added with addTcaSelectItemGroup

Parameters
$table : string

Name of TCA table

$field : string

Name of TCA field

$item : array<string|int, mixed>

New item to add

$relativeToField : string = ''

Add item relative to existing field

$relativePosition : string = ''

Valid keywords: 'before', 'after'

Tags
throws
InvalidArgumentException

If given parameters are not of correct

throws
RuntimeException

If reference to related position fields can not

addTcaSelectItemGroup()

Adds an item group to a TCA select field, allows to add a group so addTcaSelectItem() can add a groupId with a label and its position within other groups.

public static addTcaSelectItemGroup(string $table, string $field, string $groupId, string $groupLabel[, string|null $position = 'bottom' ]) : void
Parameters
$table : string

the table name in TCA - e.g. tt_content

$field : string

the field name in TCA - e.g. CType

$groupId : string

the unique identifier for a group, where all items from addTcaSelectItem() with a group ID are connected

$groupLabel : string

the label e.g. LLL:EXT:my_extension/Resources/Private/Language/locallang_tca.xlf:group.mygroupId

$position : string|null = 'bottom'

e.g. "before:special", "after:default" (where the part after the colon is an existing groupId) or "top" or "bottom"

addToAllTCAtypes()

Makes fields visible in the TCEforms, adding them to the end of (all) "types"-configurations

public static addToAllTCAtypes(string $table, string $newFieldsString[, string $typeList = '' ][, string $position = '' ]) : mixed

Adds a string $string (comma separated list of field names) to all ["types"][xxx]["showitem"] entries for table $table (unless limited by $typeList) This is needed to have new fields shown automatically in the TCEFORMS of a record from $table. Typically this function is called after having added new columns (database fields) with the addTCAcolumns function FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

Parameters
$table : string

Table name

$newFieldsString : string

Field list to add.

$typeList : string = ''

List of specific types to add the field list to. (If empty, all type entries are affected)

$position : string = ''

Insert fields before (default) or after one, or replace a field

addToInsertRecords()

Adds the $table tablename to the list of tables allowed to be includes by content element type "Insert records" By using $content_table and $content_field you can also use the function for other tables.

public static addToInsertRecords(string $table[, string $content_table = 'tt_content' ][, string $content_field = 'records' ]) : mixed

FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

Parameters
$table : string

Table name to allow for "insert record

$content_table : string = 'tt_content'

Table name TO WHICH the $table name is applied. See $content_field as well.

$content_field : string = 'records'

Field name in the database $content_table in which $table is allowed to be added as a reference ("Insert Record")

addTypoScript()

Adds $content to the default TypoScript code for either setup or constants as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_*'] (Basically this function can do the same as addTypoScriptSetup and addTypoScriptConstants - just with a little more hazzle, but also with some more options!) FOR USE IN ext_localconf.php FILES Note: As of TYPO3 CMS 6.2, static template #43 (content: default) was replaced with "defaultContentRendering" which makes it possible that a first extension like fluid_styled_content registers a "contentRendering" template (= a template that defines default content rendering TypoScript) by adding itself to $TYPO3_CONF_VARS[FE][contentRenderingTemplates][] = 'myext/Configuration/TypoScript'.

public static addTypoScript(string $key, string $type, string $content[, int|string $afterStaticUid = 0 ]) : mixed

An extension calling addTypoScript('myext', 'setup', $typoScript, 'defaultContentRendering') will add its TypoScript directly after; For now, "43" and "defaultContentRendering" can be used, but "defaultContentRendering" is more descriptive and should be used in the future.

Parameters
$key : string

Is the extension key (informative only).

$type : string

Is either "setup" or "constants" and obviously determines which kind of TypoScript code we are adding.

$content : string

Is the TS content, will be prefixed with a [GLOBAL] line and a comment-header.

$afterStaticUid : int|string = 0

string pointing to the "key" of a static_file template ([reduced extension_key]/[local path]). The points is that the TypoScript you add is included only IF that static template is included (and in that case, right after). So effectively the TypoScript you set can specifically overrule settings from those static templates.

Tags
throws
InvalidArgumentException

addTypoScriptConstants()

Adds $content to the default TypoScript constants code as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_constants'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILES

public static addTypoScriptConstants(string $content) : mixed
Parameters
$content : string

TypoScript Constants string

addTypoScriptSetup()

Adds $content to the default TypoScript setup code as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_setup'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILES

public static addTypoScriptSetup(string $content) : mixed
Parameters
$content : string

TypoScript Setup string

addUserTSConfig()

Adds $content to the default User TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultUserTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_localconf.php FILE

public static addUserTSConfig(string $content) : mixed
Parameters
$content : string

User TSconfig content

allowTableOnStandardPages()

Add tablename to default list of allowed tables on pages (in $PAGES_TYPES) Will add the $table to the list of tables allowed by default on pages as setup by $PAGES_TYPES['default']['allowedTables'] FOR USE IN ext_tables.php FILES

public static allowTableOnStandardPages(string $table) : mixed
Parameters
$table : string

Table name

buildBaseTcaFromSingleFiles()

Find all Configuration/TCA/* files of extensions and create base TCA from it.

public static buildBaseTcaFromSingleFiles() : mixed

The filename must be the table name in $GLOBALS['TCA'], and the content of the file should return an array with content of a specific table.

Internal
Tags
see
Extension

core, extensionmanager and others for examples.

createBaseTcaCacheFile()

Cache base $GLOBALS['TCA'] to cache file to require the whole thing in one file for next access instead of cycling through all extensions again.

public static createBaseTcaCacheFile(FrontendInterface $codeCache) : mixed
Parameters
$codeCache : FrontendInterface
Internal

createExtLocalconfCacheEntry()

Create cache entry for concatenated ext_localconf.php files

public static createExtLocalconfCacheEntry(FrontendInterface $codeCache) : mixed
Parameters
$codeCache : FrontendInterface
Internal

deactivateService()

Deactivate a service

public static deactivateService(string $serviceType, string $serviceKey) : mixed
Parameters
$serviceType : string

Service type

$serviceKey : string

Service key

extPath()

Returns the absolute path to the extension with extension key $key.

public static extPath(string $key[, string $script = '' ]) : string
Parameters
$key : string

Extension key

$script : string = ''

$script is appended to the output if set.

Tags
throws
BadFunctionCallException
Return values
string

findService()

Find the available service with highest priority

public static findService(string $serviceType[, string $serviceSubType = '' ][, array<string|int, mixed> $excludeServiceKeys = [] ]) : mixed
Parameters
$serviceType : string

Service type

$serviceSubType : string = ''

Service sub type

$excludeServiceKeys : array<string|int, mixed> = []

Service keys that should be excluded in the search for a service.

Return values
mixed

Service info array if a service was found, FALSE otherwise

findServiceByKey()

Find a specific service identified by its key Note that this completely bypasses the notions of priority and quality

public static findServiceByKey(string $serviceKey) : array<string|int, mixed>
Parameters
$serviceKey : string

Service key

Tags
throws
Exception
Return values
array<string|int, mixed>

Service info array if a service was found

getCN()

Returns the correct class name prefix for the extension key $key

public static getCN(string $key) : string
Parameters
$key : string

Extension key

Internal
Return values
string

getExtensionIcon()

Find extension icon

public static getExtensionIcon(string $extensionPath[, bool $returnFullPath = false ]) : string
Parameters
$extensionPath : string

Path to extension directory.

$returnFullPath : bool = false

Return full path of file.

Return values
string

getExtensionVersion()

Retrieves the version of an installed extension.

public static getExtensionVersion(string $key) : string

If the extension is not installed, this function returns an empty string.

Parameters
$key : string

The key of the extension to look up, must not be empty

Tags
throws
InvalidArgumentException
throws
Exception
Return values
string

The extension version as a string in the format "x.y.z",

getFileFieldTCAConfig()

Gets the TCA configuration for a field handling (FAL) files.

public static getFileFieldTCAConfig(string $fieldName[, array<string|int, mixed> $customSettingOverride = [] ][, string $allowedFileExtensions = '' ][, string $disallowedFileExtensions = '' ]) : array<string|int, mixed>
Parameters
$fieldName : string

Name of the field to be used

$customSettingOverride : array<string|int, mixed> = []

Custom field settings overriding the basics

$allowedFileExtensions : string = ''

Comma list of allowed file extensions (e.g. "jpg,gif,pdf")

$disallowedFileExtensions : string = ''
Return values
array<string|int, mixed>

getLoadedExtensionListArray()

Gets an array of loaded extension keys

public static getLoadedExtensionListArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

Loaded extensions

insertModuleFunction()

Adds a "Function menu module" ('third level module') to an existing function menu of some other backend module.

public static insertModuleFunction(string $modname, string $className, string $_unused, string $title[, string $MM_key = 'function' ][, string $WS = '' ]) : mixed

FOR USE IN ext_tables.php FILES

Parameters
$modname : string

Module name

$className : string

Class name

$_unused : string

not in use anymore

$title : string

Title of module

$MM_key : string = 'function'

Menu array key - default is "function

$WS : string = ''

Workspace conditions. Blank means all workspaces, any other string can be a comma list of "online", "offline" and "custom

isLoaded()

Returns TRUE if the extension with extension key $key is loaded.

public static isLoaded(string $key) : bool
Parameters
$key : string

Extension key to test

Return values
bool

isServiceAvailable()

Check if a given service is available, based on the executable files it depends on

public static isServiceAvailable(string $serviceType, string $serviceKey, array<string|int, mixed> $serviceDetails) : bool
Parameters
$serviceType : string

Type of service

$serviceKey : string

Specific key of the service

$serviceDetails : array<string|int, mixed>

Information about the service

Return values
bool

Service availability

loadBaseTca()

Wrapper for buildBaseTcaFromSingleFiles handling caching.

public static loadBaseTca([bool $allowCaching = true ][, FrontendInterface|null $codeCache = null ]) : mixed

This builds 'base' TCA that is later overloaded by ext_tables.php.

Use a cache file if exists and caching is allowed.

This is an internal method. It is only used during bootstrap and extensions should not use it!

Parameters
$allowCaching : bool = true

Whether or not to load / create concatenated cache file

$codeCache : FrontendInterface|null = null
Internal

loadExtension()

Loads given extension

public static loadExtension(string $extensionKey) : mixed

Warning: This method only works if the upgrade wizard to transform localconf.php to LocalConfiguration.php was already run

Parameters
$extensionKey : string

Extension key to load

Tags
throws
RuntimeException

loadExtLocalconf()

Execute all ext_localconf.php files of loaded extensions.

public static loadExtLocalconf([bool $allowCaching = true ][, FrontendInterface|null $codeCache = null ]) : mixed

The method implements an optionally used caching mechanism that concatenates all ext_localconf.php files in one file.

This is an internal method. It is only used during bootstrap and extensions should not use it!

Parameters
$allowCaching : bool = true

Whether or not to load / create concatenated cache file

$codeCache : FrontendInterface|null = null
Internal

loadExtTables()

Execute all ext_tables.php files of loaded extensions.

public static loadExtTables([bool $allowCaching = true ][, FrontendInterface|null $codeCache = null ]) : mixed

The method implements an optionally used caching mechanism that concatenates all ext_tables.php files in one file.

This is an internal method. It is only used during bootstrap and extensions should not use it!

Parameters
$allowCaching : bool = true

Whether to load / create concatenated cache file

$codeCache : FrontendInterface|null = null
Internal

makeCategorizable()

Makes a table categorizable by adding value into the category registry.

public static makeCategorizable(string $extensionKey, string $tableName[, string $fieldName = 'categories' ][, array<string|int, mixed> $options = [] ][, bool $override = false ]) : mixed

FOR USE IN ext_localconf.php FILES or files in Configuration/TCA/Overrides/*.php Use the latter to benefit from TCA caching!

Parameters
$extensionKey : string

Extension key to be used

$tableName : string

Name of the table to be categorized

$fieldName : string = 'categories'

Name of the field to be used to store categories

$options : array<string|int, mixed> = []

Additional configuration options

$override : bool = false

If TRUE, any category configuration for the same table / field is removed before the new configuration is added

Tags
see
addTCAcolumns
see
addToAllTCAtypes

registerPageTSConfigFile()

Call this method to add an entry in the pageTSconfig list found in pages FOR USE in Configuration/TCA/Overrides/pages.php

public static registerPageTSConfigFile(string $extKey, string $filePath, string $title) : mixed
Parameters
$extKey : string

The extension key

$filePath : string

The path where the TSconfig file is located

$title : string

The title in the selector box

Tags
throws
InvalidArgumentException

resolvePackagePath()

Temporary helper method to resolve paths with the PackageManager, because it is statically injected to this class already. This method will be removed without substitution in TYPO3 12 once a proper resource API is introduced.

public static resolvePackagePath(string $path) : string
Parameters
$path : string
Internal

This method is only allowed to be called from GeneralUtility::getFileAbsFileName()! DONT'T introduce other usages!

Tags
throws
Exception
Return values
string

setEventDispatcher()

Sets the event dispatcher to be available.

public static setEventDispatcher(EventDispatcherInterface $eventDispatcher) : mixed
Parameters
$eventDispatcher : EventDispatcherInterface
Internal

only used for tests and the internal TYPO3 Bootstrap process

setPackageManager()

Sets the package manager for all that backwards compatibility stuff, so it doesn't have to be fetched through the bootstrap.

public static setPackageManager(PackageManager $packageManager) : mixed
Parameters
$packageManager : PackageManager
Internal

unloadExtension()

Unloads given extension

public static unloadExtension(string $extensionKey) : mixed

Warning: This method only works if the upgrade wizard to transform localconf.php to LocalConfiguration.php was already run

Parameters
$extensionKey : string

Extension key to remove

Tags
throws
RuntimeException

dispatchTcaIsBeingBuiltEvent()

Triggers an event for manipulating the final TCA

protected static dispatchTcaIsBeingBuiltEvent(array<string|int, mixed> $tca) : mixed
Parameters
$tca : array<string|int, mixed>

executePositionedStringInsertion()

Inserts as list of data into an existing list.

protected static executePositionedStringInsertion(string $list, string $insertionList[, string $insertionPosition = '' ]) : string

The insertion position can be defined accordant before of after existing list items.

Example:

  • list: 'field_a, field_b, field_c'
  • insertionList: 'field_d, field_e'
  • insertionPosition: 'after:field_b' -> 'field_a, field_b, field_d, field_e, field_c'

$insertPosition may contain ; and - characters: after:--palette--;;title

Parameters
$list : string

The list of items to be extended

$insertionList : string

The list of items to inserted

$insertionPosition : string = ''

Insert fields before (default) or after one

Return values
string

The extended list

getBaseTcaCacheIdentifier()

Cache identifier of base TCA cache entry.

protected static getBaseTcaCacheIdentifier() : string
Return values
string

getExtLocalconfCacheIdentifier()

Cache identifier of concatenated ext_localconf file

protected static getExtLocalconfCacheIdentifier() : string
Return values
string

getExtTablesCacheIdentifier()

Cache identifier for concatenated ext_tables.php files

protected static getExtTablesCacheIdentifier() : string
Return values
string

loadSingleExtLocalconfFiles()

Execute ext_localconf.php files from extensions

protected static loadSingleExtLocalconfFiles() : mixed

loadSingleExtTablesFiles()

Load ext_tables.php as single files

protected static loadSingleExtTablesFiles() : mixed

removeDuplicatesForInsertion()

Compares an existing list of items and a list of items to be inserted and returns a duplicate-free variant of that insertion list.

protected static removeDuplicatesForInsertion(string $insertionList[, string $list = '' ]) : string

Example:

  • list: 'field_a, field_b, field_c'
  • insertion: 'field_b, field_d, field_c' -> new insertion: 'field_d'

Duplicate values in $insertionList are removed.

Parameters
$insertionList : string

The list of items to inserted

$list : string = ''

The list of items to be extended (default: '')

Return values
string

Duplicate-free list of items to be inserted


        
On this page

Search results