function drupal_load in Drupal 4
Same name and namespace in other branches
- 5 includes/bootstrap.inc \drupal_load()
 - 6 includes/bootstrap.inc \drupal_load()
 - 7 includes/bootstrap.inc \drupal_load()
 
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).
$name: The name of the item to load.
Return value
TRUE if the item is loaded or has already been loaded.
4 calls to drupal_load()
- bootstrap_invoke_all in includes/
bootstrap.inc  - Call all init or exit hooks without including all modules.
 - module_load_all in includes/
module.inc  - Load all the modules that have been enabled in the system table.
 - system_modules in modules/
system.module  - Menu callback; displays a listing of all modules.
 - system_theme_data in modules/
system.module  - Collect data about all currently available themes
 
File
- includes/
bootstrap.inc, line 482  - 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;
}