You are here

function drupal_install_modules in Drupal 6

Same name and namespace in other branches
  1. 5 includes/install.inc \drupal_install_modules()

Calls the install function and updates the system table for a given list of modules.

Parameters

module_list: The modules to install.

2 calls to drupal_install_modules()
install_configure_form_submit in ./install.php
Form API submit for the site configuration form.
system_modules_submit in modules/system/system.admin.inc
Submit callback; handles modules form submission.

File

includes/install.inc, line 310

Code

function drupal_install_modules($module_list = array()) {
  $files = module_rebuild_cache();
  $module_list = array_flip(array_values($module_list));
  do {
    $moved = FALSE;
    foreach ($module_list as $module => $weight) {
      $file = $files[$module];
      if (isset($file->info['dependencies']) && is_array($file->info['dependencies'])) {
        foreach ($file->info['dependencies'] as $dependency) {
          if (isset($module_list[$dependency]) && $module_list[$module] < $module_list[$dependency] + 1) {
            $module_list[$module] = $module_list[$dependency] + 1;
            $moved = TRUE;
          }
        }
      }
    }
  } while ($moved);
  asort($module_list);
  $module_list = array_keys($module_list);
  array_filter($module_list, '_drupal_install_module');
  module_enable($module_list);
}