function drush_get_modules

8.0.x environment_7.inc drush_get_modules($include_hidden = TRUE)
8.0.x environment_6.inc drush_get_modules($include_hidden = TRUE)
8.0.x environment.inc drush_get_modules($include_hidden = TRUE)
6.x environment_6.inc drush_get_modules($include_hidden = TRUE)
6.x environment.inc drush_get_modules($include_hidden = TRUE)
6.x environment_7.inc drush_get_modules($include_hidden = TRUE)
7.x environment_7.inc drush_get_modules($include_hidden = TRUE)
7.x environment_6.inc drush_get_modules($include_hidden = TRUE)
7.x environment.inc drush_get_modules($include_hidden = TRUE)
3.x environment_7.inc drush_get_modules()
3.x environment_6.inc drush_get_modules()
3.x environment_5.inc drush_get_modules()
4.x environment_6.inc drush_get_modules()
4.x environment_5.inc drush_get_modules()
4.x environment.inc drush_get_modules()
5.x environment_6.inc drush_get_modules($include_hidden = TRUE)
5.x environment.inc drush_get_modules($include_hidden = TRUE)
master environment_7.inc drush_get_modules($include_hidden = TRUE)
master environment.inc drush_get_modules($include_hidden = TRUE)

Get complete information for all available modules.

We need to set the type for those modules that are not already in the system table. Also In Drupal 5, system_modules() returns NULL for the dependency list of the module if there are no dependencies. We will override this to be an empty array instead to be compatible to Drupal 6 and 7.

Return value

An array containing module info for all available modules.

4 calls to drush_get_modules()
drush_get_projects in includes/environment.inc
Get complete information for all available modules and themes.
drush_pm_disable in commands/pm/pm.drush.inc
Command callback. Disable one or more projects.
drush_pm_enable in commands/pm/pm.drush.inc
Command callback. Enable one or more projects.
drush_pm_uninstall in commands/pm/pm.drush.inc
Command callback. Uninstall one or more modules. // TODO: Use drupal_execute on system_modules_uninstall_confirm_form so that input is validated.

File

commands/core/drupal/environment_5.inc, line 20
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_get_modules() {
  $modules = module_rebuild_cache();
  foreach ($modules as $module) {
    if (!isset($module->type)) {
      $module->type = 'module';
    }
    if (empty($module->info['dependencies'])) {
      $module->info['dependencies'] = array();
    }
    if (empty($module->info['dependents'])) {
      $module->info['dependents'] = array();
    }
  }

  return $modules;
}