function ModuleExtensionList::doList
Same name in other branches
- 9 core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::doList()
- 8.9.x core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::doList()
- 10 core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::doList()
Overrides ExtensionList::doList
File
-
core/
lib/ Drupal/ Core/ Extension/ ModuleExtensionList.php, line 153
Class
- ModuleExtensionList
- Provides a list of available modules.
Namespace
Drupal\Core\ExtensionCode
protected function doList() {
// Find modules.
$extensions = parent::doList();
// It is possible that a module was marked as required by
// hook_system_info_alter() and modules that it depends on are not required.
foreach ($extensions as $extension) {
$this->ensureRequiredDependencies($extension, $extensions);
}
// Add status, weight, and schema version.
$installed_modules = $this->configFactory
->get('core.extension')
->get('module') ?: [];
foreach ($extensions as $name => $module) {
$module->weight = $installed_modules[$name] ?? 0;
$module->status = (int) isset($installed_modules[$name]);
$module->schema_version = UpdateHookRegistry::SCHEMA_UNINSTALLED;
}
$extensions = $this->moduleHandler
->buildModuleDependencies($extensions);
if ($this->installProfile && $extensions[$this->installProfile]) {
$active_profile = $extensions[$this->installProfile];
// Installation profile hooks are always executed last.
$active_profile->weight = 1000;
// Installation profiles are hidden by default, unless explicitly
// specified otherwise in the .info.yml file.
if (!isset($active_profile->info['hidden'])) {
$active_profile->info['hidden'] = TRUE;
}
// Add a default distribution name if the profile did not provide one.
// @see install_profile_info()
// @see drupal_install_profile_distribution_name()
if (!isset($active_profile->info['distribution']['name'])) {
$active_profile->info['distribution']['name'] = 'Drupal';
}
}
return $extensions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.