Configuration option for defining loading order of extensions
It would be nice to have an additional configuration option in ext_emconf.php which allows to define the loading order of extensions, without defining a dependence.
Currently it is only possible to influence the loading order by defining dependencies:
'constraints' => array(
'depends' => array(
'typo3' => '6.2.0-6.2.999',
'php' => '5.2.0-5.4.999',
'realurl' => '1.12.0-1.12.999',
This is not suitable for my situation, because my extension does not require realurl. But in case realurl is installed, my extension must be loaded after realurl to hook into realurl correctly. My extension also works together with other extensions (cooluri, dbal, ..) but it also works without all of those.
It would be nice, if I could define which extensions (if already installed) should be loaded before and which should be loaded after my extension.
Thank you for your attention.
[TASK] Observe ext suggestions for ext loading order
Let the DependencyResolver take the suggest-part of the composer.json
or ext_emconf.php files into account. This solves issues where it is
necessary to ensure a certain loading order of extensions without
having a real dependency between those.
Reviewed-by: Loek Hilgersom
Tested-by: Loek Hilgersom
Reviewed-by: Thomas Maroschik
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
#2 Updated by Markus Klein about 6 years ago
Possible solution would be to use the "suggests" array in the emconf to announce such optional "dependencies".
In your case you would add realurl to the suggests constraints.
In case a suggested extension is depending on the suggesting one, the dependencies take precedence for the loading order.
#5 Updated by Markus Klein about 6 years ago
Ok this is more and more a real problem. rtehtmlarea needs to be loaded after setup extension in order to add the rte settings to the user settings. This is not a dependency and not really a suggestion. We could misuse "suggests" for this, but it does not really seem right to me. :-(
#18 Updated by Stanislas Rolland about 6 years ago
Markus Klein wrote:
suggest does not mean that EM should "force" you to install an extension.
I understand it more as a listing of what the author thinks is a good addition to his extension.
My understanding is that the extension manager should "suggest" to install it, and I think it used to do so.
#21 Updated by Markus Klein about 6 years ago
Stanislas: Have a look at the unit tests please.
This is the reason why dependencies take precedence over suggestions.
So if a "suggested" extension depends on the ext being installed (directly or indirectly), the suggestion is not taken into account for loading order calculation.
#22 Updated by Fabien Udriot about 6 years ago
Can we say in this regard that "suggest" would be a soft dependency? In case the suggested extension is installed, the "suggest" becomes a "require" for the Package Manager which will compute the correct order of extensions accordingly. This is how I understand it...