function module_load_all

module_load_all($bootstrap = FALSE)

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.

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!module.inc/function/module_load_all/7.x