ext_tables.php is not always included in the global scope of the
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 usually gets included later within the request and after TCA information is loaded, and a backend user is authenticated.
In many cases, the file
ext_tables.php is no longer needed,
TCA definitions must be placed in files located at
Should not be used for¶
TCA configurations for new tables. They should go in Configuration/TCA/sometable.php.
TCA overrides of existing tables. They should go in Configuration/TCA/Overrides/somefile.php.
ExtensionManagementUtility::addToInsertRecords()as this might break the frontend. They should go in Configuration/TCA/Overrides/somefile.php.
ExtensionManagementUtility::addStaticFile()as this might break the frontend. They should go in
Should be used for¶
These are the typical functions that should be placed inside
Put the following in a file called
ext_tables.php in the main directory
of your extension. The file does not need to be registered but will be loaded
<?php declare(strict_types=1); use MyVendor\MyExtension\Backend\MyClass; defined('TYPO3') or die(); // Add your code here MyClass::doSomething();
Registering a scheduler task¶
Scheduler tasks get registered in
ext_tables.php as well. Note that the system extension "scheduler" has
to be installed for this to work.
<?php declare(strict_types=1); use TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionAdditionalFieldProvider; use TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask; defined('TYPO3') or die(); $lll = 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:'; // Add caching framework garbage collection task $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'] [CachingFrameworkGarbageCollectionTask::class] = [ 'extension' => 'my_extension', 'title' => $lll . 'cachingFrameworkGarbageCollection.name', 'description' => $lll . 'cachingFrameworkGarbageCollection.description', 'additionalFields' => CachingFrameworkGarbageCollectionAdditionalFieldProvider::class, ];
Registering a backend module¶
Changed in version 13.0: The method
has been removed. Register modules in