You are here

private function HookXautoloadEarly::runHookXautoload in X Autoload 7.5

Runs hook_xautoload() on all enabled modules.

This may occur multiple times in a request, if new modules are enabled.

Parameters

array $modules:

1 call to HookXautoloadEarly::runHookXautoload()
HookXautoloadEarly::enterMainPhase in src/Phases/HookXautoloadEarly.php
Enter the main phase of the request, where all module files are included.

File

src/Phases/HookXautoloadEarly.php, line 101

Class

HookXautoloadEarly
A variation of hook_xautoload() that fires very early, as soon as a *.module file is included, but only once per module / request.

Namespace

Drupal\xautoload\Phases

Code

private function runHookXautoload(array $modules) {

  // Let other modules register stuff to the finder via hook_xautoload().
  $adapter = \xautoload_InjectedAPI_hookXautoload::create($this->finder, '');
  foreach ($modules as $module) {
    $adapter
      ->setExtensionDir($dir = $this->system
      ->drupalGetPath('module', $module));
    $function = $module . '_xautoload';
    $function($adapter, $dir);
  }
}