function DrupalExtensionAdapter::registerExtension in X Autoload 7.5
Same name and namespace in other branches
- 7.4 lib/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
- src/
Adapter/ DrupalExtensionAdapter.php, line 131
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\AdapterCode
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;
}