function drupal_load
7.x bootstrap.inc | drupal_load($type, $name) |
6.x bootstrap.inc | drupal_load($type, $name) |
Includes a file with the provided type and name. This prevents including a theme, engine, module, etc., more than once.
Parameters
$type: The type of item to load (i.e. theme, theme_engine, module, profile).
$name: The name of the item to load.
Return value
TRUE if the item is loaded or has already been loaded.
11 calls to drupal_load()
- bootstrap_invoke_all in drupal-6.x/
includes/ bootstrap.inc - Call all init or exit hooks without including all modules.
- comment_update_6002 in drupal-6.x/
modules/ comment/ comment.install - Changed comment settings from global to per-node -- copy global settings to all node types.
- drupal_uninstall_module in drupal-6.x/
includes/ install.inc - Calls the uninstall function and updates the system table for a given module.
- forum_uninstall in drupal-6.x/
modules/ forum/ forum.install - Implementation of hook_uninstall().
- hook_boot in documentation-6.x/
developer/ hooks/ core.php - Perform setup tasks. See also, hook_init.
File
- drupal-6.x/
includes/ bootstrap.inc, line 700 - Functions that need to be loaded on every Drupal request.
Code
function drupal_load($type, $name) {
static $files = array();
if (isset($files[$type][$name])) {
return TRUE;
}
$filename = drupal_get_filename($type, $name);
if ($filename) {
include_once "./$filename";
$files[$type][$name] = TRUE;
return TRUE;
}
return FALSE;
}