drupal_load

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/bootstrap.inc, строка 600

Версии
5 – 6
drupal_load($type, $name)

Подключает файл с заданным именем и типом. Эта функция предотвращает подключение тем, движков, модулей и т.п. более чем один раз.

Параметры

$type Тип загружаемого файла (например, 'theme', 'theme_engine', 'module').

$name Имя загружаемого файла.

Возвращаемое значение

TRUE, если файл успешно загрузился или был загружен ранее.

▾ 9 функции вызывают drupal_load()

bootstrap_invoke_all in includes/bootstrap.inc
Call all init or exit hooks without including all modules.
comment_update_6002 in modules/comment/comment.install
Changed comment settings from global to per-node -- copy global settings to all node types.
drupal_uninstall_module in includes/install.inc
Calls the uninstall function and updates the system table for a given module.
forum_uninstall in modules/forum/forum.install
Реализация hook_uninstall().
hook_boot in developer/hooks/core.php
Выполняет задачи при загрузке системы.
install_main in ./install.php
The Drupal installation happens in a series of steps. We begin by verifying that the current environment meets our minimum requirements. We then go on to verify that settings.php is properly configured. From there we connect to the configured database...
module_enable in includes/module.inc
Включает данный список модулей.
module_load_all in includes/module.inc
Load all the modules that have been enabled in the system table.
_drupal_maintenance_theme in includes/theme.maintenance.inc
Sets up the theming system for site installs, updates and when the site is in off-line mode. It also applies when the database is unavailable.

Код

<?php
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;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему