You are here

function HookXautoloadOperation::operateOnFinder in X Autoload 7.4

Parameters

ExtendedClassFinderInterface $finder:

DrupalExtensionAdapter $helper:

Overrides FinderOperationInterface::operateOnFinder

File

lib/FinderOperation/HookXautoloadOperation.php, line 13

Class

HookXautoloadOperation

Namespace

Drupal\xautoload\FinderOperation

Code

function operateOnFinder($finder, $helper) {

  // Let other modules register stuff to the finder via hook_xautoload().
  $classmap_generator = new ClassMapGenerator();
  $adapter = new ClassFinderAdapter($finder, $classmap_generator);
  $api = new \xautoload_InjectedAPI_hookXautoload($adapter, '');
  foreach (module_implements('xautoload') as $module) {
    $api
      ->setExtensionDir($dir = drupal_get_path('module', $module));
    $f = $module . '_xautoload';
    $f($api, $dir);
  }
}