You are here

function drupal_required_modules in Drupal 7

Same name and namespace in other branches
  1. 8 core/includes/module.inc \drupal_required_modules()
  2. 6 includes/module.inc \drupal_required_modules()
  3. 9 core/includes/module.inc \drupal_required_modules()

Returns an array of modules required by core.

1 call to drupal_required_modules()
install_profile_info in includes/install.inc
Retrieves information about an installation profile from its .info file.

File

includes/module.inc, line 985
API for loading and interacting with Drupal modules.

Code

function drupal_required_modules() {
  $files = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\\.info$/', 'modules', 'name', 0);
  $required = array();

  // An installation profile is required and one must always be loaded.
  $required[] = drupal_get_profile();
  foreach ($files as $name => $file) {
    $info = drupal_parse_info_file($file->uri);
    if (!empty($info) && !empty($info['required']) && $info['required']) {
      $required[] = $name;
    }
  }
  return $required;
}