function module_load_all

Loads all enabled modules.

Parameters

bool $bootstrap: Whether to load only the reduced set of modules loaded in "bootstrap mode" for cached pages. See bootstrap.inc. Pass NULL to only check the current status without loading of modules.

bool $reset: (optional) Internal use only. Whether to reset the internal statically cached flag of whether modules have been loaded. If TRUE, all modules are (re)loaded in the same call. Used by the testing framework to override and persist a limited module list for the duration of a unit test (in which no module system exists).

Return value

bool A Boolean indicating whether all modules have been loaded. This means all modules; the load status of bootstrap modules cannot be checked.

11 calls to module_load_all()
DrupalUnitTestBase::enableModules in drupal/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
Enables modules for this test.
drupal_flush_all_caches in drupal/core/includes/common.inc
Flushes all persistent caches, resets all variables, and rebuilds all data structures.
module_hook_info in drupal/core/includes/module.inc
Retrieves a list of hooks that are declared through hook_hook_info().
TestBase::tearDown in drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
Deletes created files, database tables, and reverts all environment changes.
theme in drupal/core/includes/theme.inc
Generates themed output.

... See full list

File

drupal/core/includes/module.inc, line 29
API for loading and interacting with Drupal modules.

Code

function module_load_all($bootstrap = FALSE, $reset = FALSE) {
  static $has_run = FALSE;
  if ($reset) {
    $has_run = FALSE;
  }

  // Unless $boostrap is NULL, load the requested set of modules.
  if (isset($bootstrap) && !$has_run) {
    $type = $bootstrap ? 'bootstrap' : 'module_enabled';
    foreach (module_list($type) as $module) {
      drupal_load('module', $module);
    }

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