module_load_include

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.

Parameters

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

$module The module to which the include file belongs.

$name Optionally, specify the base file name (without the $type extension). If not set, $module is used.

▾ 17 functions call module_load_include()

drupal_get_schema_unprocessed in includes/common.inc
Returns the unprocessed and unaltered version of a module's schema.
forum_overview in modules/forum/forum.admin.inc
Returns an overview list of existing forums and containers
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.
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_verify_assertion in modules/openid/openid.module
Attempt to verify the response received from the OpenID Provider.
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_refresh in modules/update/update.module
Wrapper to load the include file and then refresh the release data.
update_requirements in modules/update/update.module
Implementation of hook_requirements().
update_status in modules/update/update.report.inc
Menu callback. Generate a page about the update status of projects.
_update_refresh in modules/update/update.fetch.inc
Fetch project info via XML from a central server.

Code

includes/module.inc, line 265

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

  $file = './'. drupal_get_path('module', $module) ."/$name.$type";

  if (is_file($file)) {
    require_once $file;
  }
  else {
    return FALSE;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.