Loads all enabled modules.
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).
bool A Boolean indicating whether all modules have been loaded. This means all modules; the load status of bootstrap modules cannot be checked.
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;
}