Same name and namespace in other branches
  1. 4.6.x includes/module.inc \module_load_all()
  2. 4.7.x includes/module.inc \module_load_all()
  3. 5.x includes/module.inc \module_load_all()
  4. 6.x includes/module.inc \module_load_all()

Loads all the modules that have been enabled in the system table.

Parameters

$bootstrap: Whether to load only the reduced set of modules loaded in "bootstrap mode" for cached pages. See bootstrap.inc.

Return value

If $bootstrap is NULL, return a boolean indicating whether all modules have been loaded.

7 calls to module_load_all()
DrupalWebTestCase::setUp in modules/simpletest/drupal_web_test_case.php
Sets up a Drupal site for running functional and integration tests.
theme in includes/theme.inc
Generates themed output.
ThemeRegistry::__construct in includes/theme.inc
Constructs a DrupalCacheArray object.
_drupal_bootstrap_full in includes/common.inc
_drupal_bootstrap_variables in includes/bootstrap.inc
Loads system variables and all enabled bootstrap modules.

... See full list

File

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

Code

function module_load_all($bootstrap = FALSE) {
  static $has_run = FALSE;
  if (isset($bootstrap)) {
    foreach (module_list(TRUE, $bootstrap) as $module) {
      drupal_load('module', $module);
    }

    // $has_run will be TRUE if $bootstrap is FALSE.
    $has_run = !$bootstrap;
  }
  return $has_run;
}