_system_rebuild_module_data_ensure_required

_system_rebuild_module_data_ensure_required($module, &$modules)

Ensures that dependencies of required modules are also required.

Parameters

\Drupal\Core\Extension\Extension $module: The module info.

\Drupal\Core\Extension\Extension[] $modules: The array of all module info.

File

core/modules/system/system.module, line 1046
Configuration system that lets administrators modify the workings of the site.

Code

function _system_rebuild_module_data_ensure_required($module, &$modules) {
  if (!empty($module->info['required'])) {
    foreach ($module->info['dependencies'] as $dependency) {
      $dependency_name = ModuleHandler::parseDependency($dependency) ['name'];
      if (!isset($modules[$dependency_name]->info['required'])) {
        $modules[$dependency_name]->info['required'] = TRUE;
        $modules[$dependency_name]->info['explanation'] = t('Dependency of required module @module', array('@module' => $module->info['name']));
        // Ensure any dependencies it has are required.
        _system_rebuild_module_data_ensure_required($modules[$dependency_name], $modules);
      }
    }
  }
}
doc_Drupal
2016-10-29 09:57:19
Comments
Leave a Comment

Please login to continue.