function drush_module_enable

8.0.x environment_7.inc drush_module_enable($modules)
8.0.x environment_6.inc drush_module_enable($modules)
8.0.x environment.inc drush_module_enable($modules)
6.x environment_6.inc drush_module_enable($modules)
6.x environment.inc drush_module_enable($modules)
6.x environment_7.inc drush_module_enable($modules)
7.x environment_7.inc drush_module_enable($modules)
7.x environment_6.inc drush_module_enable($modules)
7.x environment.inc drush_module_enable($modules)
3.x environment_7.inc drush_module_enable($modules)
3.x environment_6.inc drush_module_enable($modules)
3.x environment_5.inc drush_module_enable($modules)
4.x environment_6.inc drush_module_enable($modules)
4.x environment_5.inc drush_module_enable($modules)
4.x environment.inc drush_module_enable($modules)
5.x environment_6.inc drush_module_enable($modules)
5.x environment.inc drush_module_enable($modules)
master environment_7.inc drush_module_enable($modules)
master environment.inc drush_module_enable($modules)

Enable a list of modules. It is assumed the list contains all the dependencies not already enabled.

Parameters

$modules: Array of module names

1 call to drush_module_enable()
drush_pm_enable in commands/pm/pm.drush.inc
Command callback. Enable one or more extensions from downloaded projects. Note that the modules and themes to be enabled were evaluated during the pm-enable validate hook, above.

File

commands/core/drupal/environment_5.inc, line 107
Specific functions for a drupal 5 environment. drush_include_engine() magically includes either this file or environment_X.inc depending on which version of drupal drush is called from.

Code

function drush_module_enable($modules) {
  // In Drupal 5, drupal_install_modules() only installs new modules,
  // and does not enable previously installed and disabled modules.
  $install_modules = array();
  $enable_modules = array();

  foreach ($modules as $module) {
    if (drupal_get_installed_schema_version($module) == SCHEMA_UNINSTALLED) {
      $install_modules[] = $module;
    }
    else {
      $enable_modules[] = $module;
    }
  }
  drupal_install_modules($install_modules);
  module_enable($enable_modules);
}