contao/core — pull request #4670 by backbone87 (2012-08-18 01:21:02+00:00)
Title: Module dependencies

Extensive tests required.
Dependency calculation tested with synthetic use cases.

Behavior:
Cycles will be dropped from the dependency map.
If a core module is involved in a cycle, complete dependency calculation is canceled and legacy module order is used (core modules before alphabetical rest).
Cycles and unresolvable modules will be added at the end of the module order.

How to define dependencies:
Create a depend.php within the config folder of your module and add entries in the dependency map.
Multiple own dependencies:
@$GLOBALS['TL_DEPEND']['myModule'][] = 'otherModule';@
@$GLOBALS['TL_DEPEND']['myModule'][] = 'otherModule';@
Injected dependencies:
@$GLOBALS['TL_DEPEND']['anOtherModule'][] = 'anOtherModule';@
Injected core dependencies:
@$GLOBALS['TL_DEPEND']['core'][] = 'myModule';@