You are here

function DrupalExtensionAdapter::registerExtension in X Autoload 7.4

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

Register lazy plugins for a given extension, assuming that we don't know yet whether it uses PSR-0, PEAR-Flat, or none of these.

Parameters

string $name:

string $type:

File

lib/Adapter/DrupalExtensionAdapter.php, line 137

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 registerExtension($name, $type) {
  if (!empty($this->registered[$name])) {

    // The extension has already been processed.
    return;
  }
  $this->namespaceMap
    ->registerDeepPath('Drupal/' . $name . '/', $name, $this->namespaceBehaviors[$type]);
  $this->prefixMap
    ->registerDeepPath(str_replace('_', '/', $name) . '/', $name, $this->prefixBehaviors[$type]);
  $this->registered[$name] = TRUE;
}