You are here

function DrupalExtensionAdapter::__construct in X Autoload 7.4

Same name and namespace in other branches
  1. 7.5 src/Adapter/DrupalExtensionAdapter.php \Drupal\xautoload\Adapter\DrupalExtensionAdapter::__construct()

Parameters

\Drupal\xautoload\DrupalSystem\DrupalSystemInterface $system:

ExtendedClassFinderInterface $finder:

File

lib/Adapter/DrupalExtensionAdapter.php, line 62

Class

DrupalExtensionAdapter
Service that knows how to register module namespaces and prefixes into the class loader, and that remembers which modules have already been registered.

Namespace

Drupal\xautoload\Adapter

Code

function __construct($system, $finder) {
  $this->system = $system;
  $this->finder = $finder;
  $this->namespaceMap = $finder
    ->getNamespaceMap();
  $this->prefixMap = $finder
    ->getPrefixMap();
  foreach (array(
    'module',
    'theme',
  ) as $extension_type) {
    $this->namespaceBehaviors[$extension_type] = new DrupalExtensionNamespaceFinderPlugin($extension_type, $this->namespaceMap, $this->prefixMap, $this->system);
    $this->prefixBehaviors[$extension_type] = new DrupalExtensionUnderscoreFinderPlugin($extension_type, $this->namespaceMap, $this->prefixMap, $this->system);
  }
  $this->defaultBehavior = new DefaultDirectoryBehavior();
}