Important: #82692 - Guidelines for ext_localconf.php and ext_tables.php
See forge#82692
Description
Each extension has two easy ways to extend TYPO3 Core, as the TYPO3 Bootstrap loads all active
extensions and include the following files of all extensions, depending on the loading order
of the extensions' dependencies located in ext_
:
1. ext_
This file is included at every request of TYPO3 (Frontend, Backend, CLI) at a very early stage, just
after the global configuration is loaded and the Package Manager knows which extensions are active.
2. ext_
This file is only included when
- a TYPO3 Backend or CLI request is happening
- or the TYPO3 Frontend is called and a valid Backend User is authenticated
This file gets usually included later within the request and after TCA information is loaded, and a Backend User is authenticated as well.
These are the typical functionalities that extension authors should place within ext_
- Registering hooks or any simple array assignments to
$TYPO3_
optionsCONF_ VARS - Registering additional Request Handlers within the Bootstrap
- Adding any PageTSconfig or Default TypoScript via
Extension
APIsManagement Utility - Registering Extbase Command Controllers
- Registering Scheduler Tasks
- Adding reports to the reports module
- Adding slots to signals via Extbase's SignalSlotDispatcher
- Registering Icons to the IconRegistry
- Registering Services via the Service API
These are the typical functions that should be placed inside ext_
- Registering of Backend modules or Backend module functions
- Adding Context-Sensitive-Help docs via ExtensionManagementUtility API
- Adding TCA descriptions (via
Extension
)Management Utility:: add LLref For TCAdescr () - Adding table options via
Extension
Management Utility:: allow Table On Standard Pages - Assignments to the global configuration arrays
$TBE_
andSTYLES $PAGES_
TYPES - Adding new fields to User Settings ("Setup" Extension)
Additionally, it is possible to extend TYPO3 in a lot of different ways (adding TCA, Backend Routes, Symfony Console Commands etc) which do not need to touch these files.
It is heavily recommended to AVOID checks on TYPO3_
or TYPO3_
constants which differentiate between contexts (e.g. if
) within these files as it limits the functionality to cache the
whole systems' configuration. Any extension author should remove the checks if not explicitly
necessary, and re-evaluate if these context-depending checks could go inside the hooks / caller
function directly. However a check, which isn't context-depending and only checks for TYPO3 like defined
is no problem.
Additionally, it is recommend to use the extension name (e.g. "tt_address") instead of $_
within the two configuration files as this variable will be removed in the future. This also applies
to $_
.
However, due to limitations to TER, the $_
option should be kept within an extensions
ext_
.
See any system extension for best practice on this behaviour.