public function ModuleHandler::loadInclude

Implements \Drupal\Core\Extension\ModuleHandlerInterface::loadInclude().

Overrides ModuleHandlerInterface::loadInclude

4 calls to ModuleHandler::loadInclude()
CachedModuleHandler::getImplementationInfo in drupal/core/lib/Drupal/Core/Extension/CachedModuleHandler.php
Overrides \Drupal\Core\Extension\ModuleHandler::getImplementationInfo().
ModuleHandler::getImplementationInfo in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Provides information about modules' implementations of a hook.
ModuleHandler::implementsHook in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Implements \Drupal\Core\Extension\ModuleHandlerInterface::implementsHook().
ModuleHandler::loadAllIncludes in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Implements \Drupal\Core\Extension\ModuleHandlerInterface::loadAllIncludes().

File

drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php, line 213
Contains Drupal\Core\Extension\ModuleHandler.

Class

ModuleHandler
Class that manages enabled modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function loadInclude($module, $type, $name = NULL) {
  if ($type == 'install') {

    // Make sure the installation API is available
    include_once DRUPAL_ROOT . '/core/includes/install.inc';
  }
  $name = $name ?: $module;
  if (isset($this->moduleList[$module])) {
    $file = DRUPAL_ROOT . '/' . dirname($this->moduleList[$module]) . "/{$name}.{$type}";
    if (is_file($file)) {
      require_once $file;
      return $file;
    }
  }
  return FALSE;
}