drupal_install_modules

Versions
5 – 6
drupal_install_modules($module_list = array())
7
drupal_install_modules($module_list = array(), $disable_modules_installed_hook = FALSE)

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

Parameters

module_list The modules to install.

▾ 2 functions call drupal_install_modules()

drupal_install_profile in includes/install.inc
Install a profile (i.e. a set of modules) from scratch. The profile must be verified first using drupal_verify_profile().
system_modules_submit in modules/system/system.module
Submit callback; handles modules form submission.

Code

includes/install.inc, line 338

<?php
function drupal_install_modules($module_list = array()) {
  $enable_modules = array();

  foreach ($module_list as $module) {
    if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) {
      module_load_install($module);
      module_invoke($module, 'install');
      $versions = drupal_get_schema_versions($module);
      drupal_set_installed_schema_version($module, $versions ? max($versions) : SCHEMA_INSTALLED);
      $enable_modules[] = $module;
    }
  }

  module_enable($enable_modules);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.