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:felogin system extension, the dependency should be defined as follows:

Excerpt of EXT:my_extension/composer.json
"require": {
    "typo3/cms-felogin": "^12.4 || ^13.4"
}
Copied!

This ensures that TYPO3 loads the extension after the ext:felogin 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:felogin system extension, the dependency should be defined as follows:

EXT:my_extension/ext_emconf.php
<?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' => [],
    ],
];
Copied!

This ensures that TYPO3 loads the extension after the ext:felogin 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.jsonrequire, conflict, and suggest — to ensure consistent loading behavior across both installation types.