module_load_include

  1. drupal
    1. 6
    2. 8
    3. 7
Versions
6 – 7 module_load_include($type, $module, $name = NULL)

Load a module include file.

Examples:

<?php
  // Load node.admin.inc from the node module.
  module_load_include('inc', 'node', 'node.admin');
  // Load content_types.inc from the node module.
  module_load_include('inc', 'node', 'content_types');
?>

Do not use this function to load an install file, use module_load_install() instead. Do not use this function in a global context since it requires Drupal to be fully bootstrapped, use require_once DRUPAL_ROOT . '/path/file' instead.

Parameters

$type The include file's type (file extension).

$module The module to which the include file belongs.

$name (optional) The base file name (without the $type extension). If omitted, $module is used; i.e., resulting in "$module.$type" by default.

Return value

The name of the included file, if successful; FALSE otherwise.

▾ 42 functions call module_load_include()

dashboard_admin_blocks in modules/dashboard/dashboard.module
Menu page callback: builds the page for administering dashboard blocks.
field_modules_uninstalled in modules/field/field.module
Implements hook_modules_uninstalled().
form_get_cache in includes/form.inc
Fetch a form from cache.
form_load_include in includes/form.inc
Loads an include file and makes sure it is loaded whenever the form is processed.
forum_overview in modules/forum/forum.admin.inc
Returns an overview list of existing forums and containers
hook_user_cancel in modules/user/user.api.php
Act on user account cancellations.
ImageEffectsUnitTest::setUp in modules/image/image.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
image_effect_apply in modules/image/image.module
Given an image object and effect, perform the effect on the file.
ModuleUnitTest::testModuleImplements in modules/simpletest/tests/module.test
Test module_implements() caching.
ModuleUpdater::getSchemaUpdates in modules/system/system.updater.inc
Return available database schema updates one a new version is installed.
module_hook in includes/module.inc
Determine whether a module implements a hook.
module_implements in includes/module.inc
Determine which modules are implementing a hook.
module_load_all_includes in includes/module.inc
Load an include file for each of the modules that have been enabled in the system table.
module_load_install in includes/module.inc
Load a module's installation hooks.
node_user_cancel in modules/node/node.module
Implements hook_user_cancel().
OpenIDUnitTest::setUp in modules/openid/openid.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
openid_association in modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_association_request in modules/openid/openid.module
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
openid_authentication_request in modules/openid/openid.module
openid_begin in modules/openid/openid.module
The initial step of OpenID authentication responsible for the following:
openid_complete in modules/openid/openid.module
Completes OpenID authentication by validating returned data from the OpenID Provider.
openid_discovery in modules/openid/openid.module
Perform discovery on a claimed ID to determine the OpenID provider endpoint.
openid_form_user_register_form_alter in modules/openid/openid.module
Implements hook_form_FORM_ID_alter().
openid_test_install in modules/openid/tests/openid_test.install
Implements hook_install().
openid_verify_assertion in modules/openid/openid.module
Attempt to verify the response received from the OpenID Provider.
update_create_fetch_task in modules/update/update.module
Wrapper to load the include file and then create a new fetch task.
update_fetch_data in modules/update/update.module
Wrapper to load the include file and then attempt to fetch update data.
update_get_available in modules/update/update.module
Internal helper to try to get the update information from the cache if possible, and to refresh the cache when necessary.
update_manager_install_form_submit in modules/update/update.manager.inc
Handle form submission when installing new projects via the update manager.
update_manager_update_form in modules/update/update.manager.inc
Build the form for the update manager page to update existing projects.
update_manager_update_ready_form_submit in modules/update/update.manager.inc
Submit handler for the form to confirm that an update should continue.
update_refresh in modules/update/update.module
Wrapper to load the include file and then refresh the release data.
update_requirements in modules/update/update.install
Implements hook_requirements().
update_status in modules/update/update.report.inc
Menu callback. Generate a page about the update status of projects.
update_update_7000 in modules/update/update.install
Create a queue to store tasks for requests to fetch available update data.
user_admin_settings in modules/user/user.admin.inc
Form builder; Configure user settings for this site.
user_menu_site_status_alter in modules/user/user.module
Implements hook_menu_site_status_alter().
user_multiple_cancel_confirm in modules/user/user.module
_openid_test_endpoint_associate in modules/openid/tests/openid_test.module
OpenID endpoint; handle "associate" requests (see OpenID Authentication 2.0, section 8).
_openid_test_endpoint_authenticate in modules/openid/tests/openid_test.module
OpenID endpoint; handle "authenticate" requests.
_update_refresh in modules/update/update.fetch.inc
Clear out all the cached available update data and initiate re-fetching.

Code

includes/module.inc, line 294

<?php
function module_load_include($type, $module, $name = NULL) {
  if (!isset($name)) {
    $name = $module;
  }

  if (function_exists('drupal_get_path')) {
    $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type";
    if (is_file($file)) {
      require_once $file;
      return $file;
    }
  }
  return FALSE;
}
?>