You are here

private function LibrariesFinderPlugin::registerAllLibraries in X Autoload 7.5

Registers all libraries that have an "xautoload" setting.

1 call to LibrariesFinderPlugin::registerAllLibraries()
LibrariesFinderPlugin::findFile in src/Libraries/LibrariesFinderPlugin.php
Find the file for a class that in PSR-0 or PEAR would be in $psr_0_root . '/' . $path_fragment . $path_suffix

File

src/Libraries/LibrariesFinderPlugin.php, line 73

Class

LibrariesFinderPlugin
Registers autoload mappings from all libraries on hook_init(), or after the first cache miss.

Namespace

Drupal\xautoload\Libraries

Code

private function registerAllLibraries() {
  $adapter = \xautoload_InjectedAPI_hookXautoload::create($this->finder, '');
  foreach ($info = $this
    ->getLibrariesXautoloadInfo() as $name => $pathAndCallback) {
    list($path, $callback) = $pathAndCallback;
    if (!is_callable($callback)) {
      continue;
    }
    if (!is_dir($path)) {
      continue;
    }
    $adapter
      ->setExtensionDir($path);
    call_user_func($callback, $adapter, $path);
  }
}