- The "list" of extensions defines the list of enabled/installed extensions.
- There is a list for each extension type: profile, module, theme, theme_engine.
The installation profile
- is defined as
$settings['install_profile']
in settings.php (but only its name) - is added to the list of enabled modules with a weight of 1000 in
drupal_rebuild_module_data()
- is contained in the
%container.modules%
parameter on the service container
There is a second"parent" installation profile when a test is executed, which
- is defined as
$config['simpletest.settings']['parent_profile']
in config/settings.php (only its name) - is NOT added to the list of enabled modules
- is NOT contained in the
%container.modules%
parameter of the service container - is only used by
ExtensionDiscovery
to additionally find extensions in the parent installation profile, from which tests were executed.
- is defined as
The list of enabled modules
- is maintained by
ModuleHandler::install()
andModuleHandler::uninstall()
- is stored in the
core.extension
configuration object - is contained in the
%container.modules%
parameter on the service container - can be manipulated at runtime (without touching configuration) via
ModuleHandler::setModuleList()
- is consumed by
system_rebuild_module_data()
to enhance module info with a$status
property reflecting the installation status
Aside from that and the
system_rebuild_module_data()
aspect, management and maintenance of the module list is pretty clean already.- is maintained by
The list of enabled themes
- is maintained by
ThemeHandler::install()
andThemeHandler::uninstall()
- is stored in the
core.extension
configuration object - is consumed, enhanced with theme info, and cached by
system_list()
- is consumed by
system_rebuild_theme_data()
to enhance theme info with a$status
property reflecting the status (whereas there is no installation status yet)
Except of the
core.extension:theme
configuration, this list factually does not really exist on its own right now — it is deeply intertwined with theme info currently.The list is also not stored in an efficient way like the
%container.modules%
parameter on the service container; i.e., the system always has to consult the configuration system to retrieve it.- is maintained by
The list of theme engines
- does not exist at all.
ThemeHandler::rebuildThemeData()
blatantly performs anExtensionDiscovery
to simply retrieve all available engines.
Proposed solution
Provide a common way to list extensions (enabled and not enabled ones)
→ Central data source for
ExtensionList
(ModuleExtensionList, ThemeExtensionList, ...)→ Provide common methods for e.g. resolving dependencies
→ Use it directly for profiles and theme engines.
Try to untangle at least some of the theme list/data/info mess.