‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Utility\ExtensionManagementUtility Class Reference
Inheritance diagram for TYPO3\CMS\Core\Utility\ExtensionManagementUtility:
TYPO3\CMS\Core\Tests\Unit\Utility\AccessibleProxies\ExtensionManagementUtilityAccessibleProxy

Static Public Member Functions

static setPackageManager (PackageManager $packageManager)
 
static isLoaded (string $key)
 
static resolvePackagePath (string $path)
 
static extPath (string $key, string $script='')
 
static getCN (string $key)
 
static string getExtensionVersion (string $key)
 
static addTCAcolumns (string $table, array $columnArray)
 
static addToAllTCAtypes (string $table, string $newFieldsString, string $typeList='', string $position='')
 
static addFieldsToAllPalettesOfField (string $table, string $field, string $addFields, string $insertionPosition='')
 
static addFieldsToPalette (string $table, string $palette, string $addFields, string $insertionPosition='')
 
static addTcaSelectItem (string $table, string $field, array $item, string $relativeToField='', string $relativePosition='')
 
static addTcaSelectItemGroup (string $table, string $field, string $groupId, string $groupLabel, ?string $position='bottom')
 
static addFieldsToUserSettings (string $addFields, string $insertionPosition='')
 
static addPageTSConfig (string $content)
 
static addUserTSConfig (string $content)
 
static addService (string $extKey, string $serviceType, string $serviceKey, array $info)
 
static array false findService (string $serviceType, string $serviceSubType='', array $excludeServiceKeys=[])
 
static array findServiceByKey (string $serviceKey)
 
static bool isServiceAvailable (string $serviceType, string $serviceKey, array $serviceDetails)
 
static deactivateService (string $serviceType, string $serviceKey)
 
static addPlugin (array|SelectItem $itemArray, string $type='list_type', ?string $extensionKey=null)
 
static addPiFlexFormValue (string $piKeyToMatch, string $value, string $CTypeToMatch='list')
 
static addToInsertRecords (string $table, string $content_table='tt_content', string $content_field='records')
 
static addPItoST43 (string $key, string $_='', string $suffix='', string $type='list_type', bool $cacheable=false)
 
static addStaticFile (string $extKey, string $path, string $title)
 
static registerPageTSConfigFile (string $extKey, string $filePath, string $title)
 
static addTypoScriptSetup (string $content, bool $includeInSiteSets=true)
 
static addTypoScriptConstants (string $content, bool $includeInSiteSets=true)
 
static addTypoScript (string $key, string $type, string $content, int|string $afterStaticUid=0, bool $includeInSiteSets=true)
 
static getExtensionIcon (string $extensionPath, bool $returnFullPath=false)
 
static getLoadedExtensionListArray ()
 
static loadExtension (string $extensionKey)
 
static unloadExtension (string $extensionKey)
 

Static Protected Member Functions

static string executePositionedStringInsertion (string $list, string $insertionList, string $insertionPosition='')
 
static string removeDuplicatesForInsertion (string $insertionList, string $list='')
 

Static Protected Attributes

static PackageManager $packageManager
 

Detailed Description

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');

Definition at line 31 of file ExtensionManagementUtility.php.

Member Function Documentation

◆ addFieldsToAllPalettesOfField()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField ( string  $table,
string  $field,
string  $addFields,
string  $insertionPosition = '' 
)
static

Adds new fields to all palettes that is defined after an existing field. 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
string$table‪Name of the table
string$field‪Name of the field that has the palette to be extended
string$addFields‪Comma-separated list of fields to be added to the palette
string$insertionPosition‪Insert fields before (default) or after one

Definition at line 294 of file ExtensionManagementUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addFieldsToPalette(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsAfterExistingIfRequested(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsBeforeExistingIfRequested(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsFieldsAtEndIfAfterRequestedDoesNotExist(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsFieldsAtEndIfBeforeRequestedDoesNotExist(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsFieldsToMultiplePalettes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsFieldsToPaletteAndSuppressesDuplicates(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsMultipleFields(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsNewPaletteIfFieldHasNoPaletteYet(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldAddsNewPaletteIfFieldHasNoPaletteYetAndKeepsExistingLabel(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldDoesNotAddAFieldThatIsPartOfPaletteAlready(), and TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addFieldsToAllPalettesOfFieldDoesNotAddAnythingIfFieldIsNotRegisteredInColumns().

◆ addFieldsToPalette()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette ( string  $table,
string  $palette,
string  $addFields,
string  $insertionPosition = '' 
)
static

Adds new fields to a palette. 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
string$table‪Name of the table
string$palette‪Name of the palette to be extended
string$addFields‪Comma-separated list of fields to be added to the palette
string$insertionPosition‪Insert fields before (default) or after one

Definition at line 347 of file ExtensionManagementUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\executePositionedStringInsertion(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\removeDuplicatesForInsertion().

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addFieldsToAllPalettesOfField(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addToAllTCAtypes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToPaletteAfterExistingOnes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToPaletteAfterNotExistingOnes(), and TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToPaletteBeforeExistingOnes().

◆ addFieldsToUserSettings()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToUserSettings ( string  $addFields,
string  $insertionPosition = '' 
)
static

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

Parameters
string$addFields‪List of fields to be added to the user settings
string$insertionPosition‪Insert fields before (default) or after one

Definition at line 496 of file ExtensionManagementUtility.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\executePositionedStringInsertion().

◆ addPageTSConfig()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig ( string  $content)
static

Adds $content to the default page TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultPageTSconfig']

Deprecated:
‪since TYPO3 v13.0, will be removed in TYPO3 v14.0.

Definition at line 612 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addPiFlexFormValue()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue ( string  $piKeyToMatch,
string  $value,
string  $CTypeToMatch = 'list' 
)
static

Adds an entry to the "ds" array of the tt_content field "pi_flexform". 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
string$piKeyToMatch‪Plugin key as used in the list_type field. Use the asterisk * to match all list_type values.
string$value‪Either a reference to a flex-form XML file (eg. "FILE:EXT:newloginbox/flexform_ds.xml") or the XML directly.
string$CTypeToMatch‪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.
See also
addPlugin()

Definition at line 880 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addPItoST43()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43 ( string  $key,
string  $_ = '',
string  $suffix = '',
string  $type = 'list_type',
bool  $cacheable = false 
)
static

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

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
  • ‪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
string$key‪The extension key
string$_‪unused since TYPO3 CMS 8
string$suffix‪Is used as a suffix of the class name (e.g. "_pi1")
string$type‪See description above
bool$cacheable‪If $cached is set as USER content object (cObject) is created - otherwise a USER_INT object is created.

Definition at line 927 of file ExtensionManagementUtility.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addTypoScript(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\getCN().

◆ addPlugin()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin ( array|SelectItem  $itemArray,
string  $type = 'list_type',
?string  $extensionKey = null 
)
static

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. 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
array | SelectItem$itemArray‪Numerical or assoc array: [0 or 'label'] => Plugin label, [1 or 'value'] => Plugin identifier / plugin key, ideally prefixed with an extension-specific name (e.g. "events2_list"), [2 or 'icon'] => Icon identifier or path to plugin icon, [3 or 'group'] => an optional "group" ID, falls back to "default"
string | null$extensionKey‪The extension key
Exceptions

Definition at line 814 of file ExtensionManagementUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Schema\Struct\SelectItem\fromTcaItemArray(), and TYPO3\CMS\Core\Schema\Struct\SelectItem\withIcon().

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addPluginAsContentTypeAddsIconAndDefaultItem(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addPluginAsContentTypeAddsIconAndDefaultItemWithSelectItem(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addPluginSetsCorrectItemGroupsEntry(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addPluginSetsTcaCorrectlyForGivenExtKeyAsParameter(), and TYPO3\CMS\Extbase\Utility\ExtensionUtility\registerPlugin().

◆ addService()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService ( string  $extKey,
string  $serviceType,
string  $serviceKey,
array  $info 
)
static

Adds a service to the global services array

Parameters
string$extKey‪Extension key
string$serviceTypeService type, must not be prefixed "tx_" or "Tx_"
string$serviceKeyService key, must be prefixed "tx_", "Tx_" or "user_"
array$infoService description array

Definition at line 648 of file ExtensionManagementUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\deactivateService(), TYPO3\CMS\Core\Core\Environment\isWindows(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addServiceDoesNotFailIfValueIsNotSet().

◆ addStaticFile()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile ( string  $extKey,
string  $path,
string  $title 
)
static

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.

Parameters
string$extKey‪Is of course the extension key
string$path‪Is the path where the template files "constants.typoscript", "setup.typoscript", and "include_static_file.txt" are found (relative to extPath, eg. "Configuration/TypoScript/Static/"). The file "include_static_file.txt", allows including 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, example: EXT:fluid_styled_content/Configuration/TypoScript/,EXT:other_extension/Configuration/TypoScript/
string$title‪Is the title in the selector box.
Exceptions

Definition at line 981 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addTCAcolumns()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns ( string  $table,
array  $columnArray 
)
static

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. 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
string$table‪The table name of a table already present in $GLOBALS['TCA'] with a columns section
array$columnArray‪The array with the additional columns (typical some fields an extension wants to add)

Definition at line 145 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addTcaSelectItem()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem ( string  $table,
string  $field,
array  $item,
string  $relativeToField = '',
string  $relativePosition = '' 
)
static

Add an item to a select field item list.

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

Exceptions

Definition at line 391 of file ExtensionManagementUtility.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\ArrayUtility\filterByValueRecursive().

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addTcaSelectItemInsertsItemAtSpecifiedPosition(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addTcaSelectItemThrowsExceptionIfFieldIsNotFoundInTca(), and TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addTcaSelectItemThrowsExceptionIfRelativePositionIsNotOneOfValidKeywords().

◆ addTcaSelectItemGroup()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItemGroup ( string  $table,
string  $field,
string  $groupId,
string  $groupLabel,
?string  $position = 'bottom' 
)
static

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.

Parameters
string$table‪the table name in TCA - e.g. tt_content
string$field‪the field name in TCA - e.g. CType
string$groupId‪the unique identifier for a group, where all items from addTcaSelectItem() with a group ID are connected
string$groupLabel‪the label e.g. LLL:EXT:my_extension/Resources/Private/Language/locallang_tca.xlf:group.mygroupId
string | null$position‪e.g. "before:special", "after:default" (where the part after the colon is an existing groupId) or "top" or "bottom"

Definition at line 438 of file ExtensionManagementUtility.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addTcaSelectItemGroupAddsGroup().

◆ addToAllTCAtypes()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes ( string  $table,
string  $newFieldsString,
string  $typeList = '',
string  $position = '' 
)
static

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

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
string$table‪Table name
string$newFieldsString‪Field list to add.
string$typeList‪Comma-separated list of specific types to add the field list to. (If empty, all type entries are affected)
string$position‪Insert fields before (default) or after one, or replace a field

Definition at line 166 of file ExtensionManagementUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addFieldsToPalette(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\executePositionedStringInsertion(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addToAllTCAtypesAddsBeforeDiv(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addToAllTCAtypesAddsToPaletteIdentifier(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\addToAllTCAtypesReplacesExistingOnes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToAllTCATypesAfterExistingOnes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToAllTCATypesBeforeExistingOnes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToAllTCATypesRespectsPalettes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToAllTCATypesRespectsPositionFieldInPalette(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToTCATypeAfterExistingOnes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToTCATypeAndReplaceExistingOnes(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldsToTCATypeBeforeExistingOnes(), and TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\canAddFieldWithPartOfAlreadyExistingFieldname().

◆ addToInsertRecords()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords ( string  $table,
string  $content_table = 'tt_content',
string  $content_field = 'records' 
)
static

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. FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.

Parameters
string$table‪Table name to allow for "insert record
string$content_table‪Table name TO WHICH the $table name is applied. See $content_field as well.
string$content_field‪Field name in the database $content_table in which $table is allowed to be added as a reference ("Insert Record")

Definition at line 896 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addTypoScript()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript ( string  $key,
string  $type,
string  $content,
int|string  $afterStaticUid = 0,
bool  $includeInSiteSets = true 
)
static

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'. 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
string$key‪Is the extension key (informative only).
string$type‪Is either "setup" or "constants" and obviously determines which kind of TypoScript code we are adding.
string$content‪Is the TS content, will be prefixed with a [GLOBAL] line and a comment-header.
int | string$afterStaticUid‪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.
Exceptions

Definition at line 1088 of file ExtensionManagementUtility.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addPItoST43(), and TYPO3\CMS\Extbase\Utility\ExtensionUtility\configurePlugin().

◆ addTypoScriptConstants()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants ( string  $content,
bool  $includeInSiteSets = true 
)
static

Adds $content to the default TypoScript constants code as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_constants'] NOT prefixed with a [GLOBAL] line, other calls MUST properly close their conditions! FOR USE IN ext_localconf.php FILES

Parameters
string$contentTypoScript Constants string
bool$includeInSiteSets

Definition at line 1055 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addTypoScriptSetup()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup ( string  $content,
bool  $includeInSiteSets = true 
)
static

Adds $content to the default TypoScript setup code as set in $GLOBALS['TYPO3_CONF_VARS'][FE]['defaultTypoScript_setup']. NOT prefixed with a [GLOBAL] line, other calls MUST properly close their conditions! FOR USE IN ext_localconf.php FILES

Parameters
string$contentTypoScript Setup string
bool$includeInSiteSets

Definition at line 1030 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ addUserTSConfig()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig ( string  $content)
static

Adds $content to the default user TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultUserTSconfig']

Deprecated:
‪since TYPO3 v13.0, will be removed in TYPO3 v14.0.

Definition at line 626 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ deactivateService()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::deactivateService ( string  $serviceType,
string  $serviceKey 
)
static

Deactivate a service

Parameters
string$serviceTypeService type
string$serviceKeyService key

Definition at line 791 of file ExtensionManagementUtility.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addService(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isServiceAvailable().

◆ executePositionedStringInsertion()

static string TYPO3\CMS\Core\Utility\ExtensionManagementUtility::executePositionedStringInsertion ( string  $list,
string  $insertionList,
string  $insertionPosition = '' 
)
staticprotected

Inserts as list of data into an existing list. 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
string$list‪The list of items to be extended
string$insertionList‪The list of items to inserted
string$insertionPosition‪Insert fields before (default) or after one
Returns
‪string The extended list

Definition at line 518 of file ExtensionManagementUtility.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\removeDuplicatesForInsertion(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addFieldsToPalette(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addFieldsToUserSettings(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addToAllTCAtypes().

◆ extPath()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath ( string  $key,
string  $script = '' 
)
static

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

Parameters
string$key‪Extension key
string$script‪$script is appended to the output if set.
Exceptions

Definition at line 82 of file ExtensionManagementUtility.php.

Referenced by TYPO3\CMS\Install\UpgradeAnalysis\DocumentationFile\__construct(), TYPO3\CMS\Install\Controller\EnvironmentController\convertImageFormatsToJpg(), TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerMarkFullyScannedRestFilesAction(), TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerScanFileAction(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\extPathAppendsScriptNameToPath(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\extPathThrowsExceptionIfExtensionIsNotLoaded(), TYPO3\CMS\Install\Controller\UpgradeController\getDocumentationDirectories(), TYPO3\CMS\Install\Controller\UpgradeController\getDocumentationFiles(), TYPO3\CMS\Fluid\View\TemplatePaths\getExtensionPrivateResourcesPath(), TYPO3\CMS\Core\TypoScript\IncludeTree\TsConfigTreeBuilder\getRootlinePageTsConfigTree(), TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend\getTableDefinitions(), TYPO3\CMS\Frontend\Imaging\GifBuilder\getTemporaryImageWithText(), TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateTreeBuilder\handleSingleIncludeStaticFile(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingCombineGifMaskAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingCombineJpgMaskAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGdlibFromFileAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGdlibFromFileToWebpAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGdlibNiceTextAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGdlibNiceTextShadowAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGdlibRenderTextAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGifToGifAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingGifToJpgAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingJpgToWebpAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingPngToPngAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingTrueTypeAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingWriteGifAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingWritePngAction(), TYPO3\CMS\Install\Controller\EnvironmentController\imageProcessingWriteWebpAction(), TYPO3\CMS\Core\Charset\CharsetConverter\initCharset(), TYPO3\CMS\Core\Charset\CharsetConverter\initUnicodeData(), and TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController\referenceIndexAction().

◆ findService()

static array false TYPO3\CMS\Core\Utility\ExtensionManagementUtility::findService ( string  $serviceType,
string  $serviceSubType = '',
array  $excludeServiceKeys = [] 
)
static

Find the available service with highest priority

Parameters
string$serviceTypeService type
string$serviceSubTypeService sub type
array$excludeServiceKeysService keys that should be excluded in the search for a service.
Returns
‪array|false Service info array if a service was found, FALSE otherwise

Definition at line 691 of file ExtensionManagementUtility.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isServiceAvailable().

◆ findServiceByKey()

static array TYPO3\CMS\Core\Utility\ExtensionManagementUtility::findServiceByKey ( string  $serviceKey)
static

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

Parameters
string$serviceKeyService key
Returns
‪array Service info array if a service was found
Exceptions

Definition at line 741 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ getCN()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN ( string  $key)
static

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

Parameters
string$key‪Extension key

Definition at line 96 of file ExtensionManagementUtility.php.

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addPItoST43(), and TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\getClassNamePrefixForExtensionKey().

◆ getExtensionIcon()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionIcon ( string  $extensionPath,
bool  $returnFullPath = false 
)
static

Find extension icon

Parameters
string$extensionPath‪Path to extension directory.
bool$returnFullPath‪Return full path of file.
Deprecated:
‪will be removed in TYPO3 v14.0 - Use Package->getPackageIcon() instead.

Definition at line 1135 of file ExtensionManagementUtility.php.

◆ getExtensionVersion()

static string TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion ( string  $key)
static

◆ getLoadedExtensionListArray()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray ( )
static

◆ isLoaded()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded ( string  $key)
static

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

Definition at line 55 of file ExtensionManagementUtility.php.

Referenced by TYPO3\CMS\Backend\Module\ModuleProvider\accessGranted(), TYPO3\CMS\Core\TypoScript\IncludeTree\TreeFromLineStreamBuilder\addStaticMagicFromGlobals(), TYPO3\CMS\Impexp\Import\checkImportPrerequisites(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkWorkspace(), TYPO3\CMS\Beuser\Service\UserInformationService\convert(), TYPO3\CMS\Core\DataHandling\DataHandler\createRelationHandlerInstance(), TYPO3\CMS\Belog\Controller\BackendLogController\createWorkspaceListForSelectOptions(), TYPO3\CMS\Extensionmanager\Controller\ListController\distributionsAction(), TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterUninstallExtensionAction(), TYPO3\CMS\Belog\Controller\BackendLogController\forceWorkspaceSelectionIfInWorkspace(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getDefaultWorkspace(), TYPO3\CMS\Backend\Controller\RecordListController\getDocHeaderButtons(), TYPO3\CMS\Dashboard\Widgets\Provider\SysLogButtonProvider\getElementAttributes(), TYPO3\CMS\Fluid\View\TemplatePaths\getExtensionPrivateResourcesPath(), TYPO3\CMS\Core\Database\ReferenceIndex\getListOfActiveWorkspaces(), TYPO3\CMS\Core\Database\ReferenceIndex\getRelationsFromRelationField(), TYPO3\CMS\Backend\Controller\MfaConfigurationController\getReturnUrl(), TYPO3\CMS\Core\TypoScript\IncludeTree\TsConfigTreeBuilder\getRootlinePageTsConfigTree(), TYPO3\CMS\Backend\RecordList\DatabaseRecordList\getTable(), TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateTreeBuilder\handleSingleIncludeStaticFile(), TYPO3\CMS\Extensionmanager\Utility\DependencyUtility\isDependentExtensionLoaded(), TYPO3\CMS\Core\Hooks\TcaDisplayConditions\isExtensionInstalled(), TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\isLoadedReturnsFalseIfExtensionIsNotLoaded(), TYPO3\CMS\Core\DataHandling\PlainDataResolver\isWorkspaceEnabled(), TYPO3\CMS\Backend\Clipboard\Clipboard\linkItemText(), TYPO3\CMS\Extensionmanager\ViewHelpers\RemoveExtensionViewHelper\render(), TYPO3\CMS\Backend\Controller\NewRecordController\renderNewRecordControls(), TYPO3\CMS\Belog\ViewHelpers\WorkspaceTitleViewHelper\renderStatic(), TYPO3\CMS\Backend\Controller\SwitchUserController\switchUserAction(), TYPO3\CMS\Core\Database\ReferenceIndex\updateIndex(), TYPO3\CMS\Extensionmanager\Updates\FeLoginModeExtractionUpdate\updateNecessary(), and TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspaceCheckStageForCurrent().

◆ isServiceAvailable()

static bool TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isServiceAvailable ( string  $serviceType,
string  $serviceKey,
array  $serviceDetails 
)
static

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

Parameters
string$serviceTypeType of service
string$serviceKey‪Specific key of the service
array$serviceDetailsInformation about the service
Returns
‪bool Service availability

Definition at line 768 of file ExtensionManagementUtility.php.

References TYPO3\CMS\Core\Utility\CommandUtility\checkCommand(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\deactivateService(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\findService().

◆ loadExtension()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension ( string  $extensionKey)
static

Loads given extension

Parameters
string$extensionKey‪Extension key to load
Exceptions

Definition at line 1163 of file ExtensionManagementUtility.php.

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\ExtensionManagementUtilityTest\loadExtensionThrowsExceptionIfExtensionIsLoaded().

◆ registerPageTSConfigFile()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile ( string  $extKey,
string  $filePath,
string  $title 
)
static

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

Parameters
string$extKey‪The extension key
string$filePath‪The path where the TSconfig file is located
string$title‪The title in the selector box
Exceptions

Definition at line 1005 of file ExtensionManagementUtility.php.

References $GLOBALS.

◆ removeDuplicatesForInsertion()

static string TYPO3\CMS\Core\Utility\ExtensionManagementUtility::removeDuplicatesForInsertion ( string  $insertionList,
string  $list = '' 
)
staticprotected

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

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
string$insertionList‪The comma-separated list of items to inserted
string$list‪The comma-separated list of items to be extended
Returns
‪string Duplicate-free list of items to be inserted

Definition at line 581 of file ExtensionManagementUtility.php.

Referenced by TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addFieldsToPalette(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\executePositionedStringInsertion().

◆ resolvePackagePath()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::resolvePackagePath ( string  $path)
static

Temporary helper method to resolve paths with the PackageManager.

The PackageManager is statically injected to this class already. This method will be removed without substitution in TYPO3 12 once a proper resource API is introduced.

Exceptions
PackageException

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

Definition at line 70 of file ExtensionManagementUtility.php.

◆ setPackageManager()

static TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager ( PackageManager  $packageManager)
static

◆ unloadExtension()

Member Data Documentation

◆ $packageManager

PackageManager TYPO3\CMS\Core\Utility\ExtensionManagementUtility::$packageManager
staticprotected