Extension loading order
In TYPO3, the order in which extensions are loaded can impact system behavior. This is especially important when an extension overrides, extends, or modifies the functionality of another. TYPO3 initializes extensions in a defined order, and if dependencies are not loaded beforehand, it can lead to unintended behavior.
Composer-based installations: Loading order via composer.json
In Composer-based installations, extensions and dependencies are
installed based on the configuration in the
composer.json
file.
For example, if an extension relies on or modifies functionality provided by
the
ext:
system extension, the dependency should be defined
as follows:
This ensures that TYPO3 loads the extension after the
ext:
system extension.
Instead of require
, extensions can also use the suggest
section.
Suggested extensions, if installed, are loaded before the current one —
just like required ones — but without being mandatory.
A typical use case is suggesting an extension that provides optional widgets, such as for EXT:dashboard.
Classic installations: Loading order via ext_emconf.php
In classic installations, extensions are loaded based on the order defined in the
ext_emconf.php
file.
For example, if an extension relies on or modifies functionality provided by
the
ext:
system extension, the dependency should be defined
as follows:
<?php
$EM_CONF[$_EXTKEY] = [
'title' => 'Extension extending ext:felogin',
'state' => 'stable',
'version' => '1.0.0',
'constraints' => [
'depends' => [
'felogin' => '12.4.0-13.4.99',
],
'conflicts' => [],
'suggests' => [],
],
];
This ensures that TYPO3 loads the extension after the
ext:
system extension.
As with Composer, you can use the suggest
section instead of depends
.
Suggested extensions, if installed, are loaded before the current one,
without being strictly required.
Keeping the loading order in sync between Composer-based and classic installations
If your extension supports both Composer-based and classic TYPO3 installations,
you should keep dependency information consistent between the
composer.json
and
ext_emconf.php files.
This is especially important for managing dependency constraints such as
depends
, conflicts
, and suggests
. Use the equivalent fields in
composer.json
— require
, conflict
, and
suggest
— to ensure consistent loading behavior across both installation types.