1 module.inc 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

core/includes/module.inc, line 18
API for loading and interacting with Backdrop modules.

Code

function module_load_all($bootstrap = FALSE) {
  static $has_run = FALSE;

  if (isset($bootstrap)) {
    foreach (module_list(TRUE, $bootstrap) as $module) {
      backdrop_load('module', $module);
    }
    // When fully loading all modules, clear the registry to make sure it
    // includes classes provided by non-bootstrap modules.
    if (!$bootstrap) {
      $has_run = TRUE;
      backdrop_static_reset('backdrop_autoload');
    }
  }
  return $has_run;
}