protected function ModuleExtensionList::ensureRequiredDependencies in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::ensureRequiredDependencies()
- 10 core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::ensureRequiredDependencies()
Marks dependencies of required modules as 'required', recursively.
Parameters
\Drupal\Core\Extension\Extension $module: The module extension object.
\Drupal\Core\Extension\Extension[] $modules: Extension objects for all available modules.
1 call to ModuleExtensionList::ensureRequiredDependencies()
- ModuleExtensionList::doList in core/
lib/ Drupal/ Core/ Extension/ ModuleExtensionList.php - Builds the list of extensions.
File
- core/
lib/ Drupal/ Core/ Extension/ ModuleExtensionList.php, line 210
Class
- ModuleExtensionList
- Provides a list of available modules.
Namespace
Drupal\Core\ExtensionCode
protected function ensureRequiredDependencies(Extension $module, array $modules = []) {
if (!empty($module->info['required'])) {
foreach ($module->info['dependencies'] as $dependency) {
$dependency_name = Dependency::createFromString($dependency)
->getName();
if (!isset($modules[$dependency_name]->info['required'])) {
$modules[$dependency_name]->info['required'] = TRUE;
$modules[$dependency_name]->info['explanation'] = $this
->t('Dependency of required module @module', [
'@module' => $module->info['name'],
]);
// Ensure any dependencies it has are required.
$this
->ensureRequiredDependencies($modules[$dependency_name], $modules);
}
}
}
}