function DrupalExtensionAdapter::registerExtensions in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/Adapter/DrupalExtensionAdapter.php \Drupal\xautoload\Adapter\DrupalExtensionAdapter::registerExtensions()
Register lazy plugins for enabled Drupal modules and themes, assuming that we don't know yet whether they use PSR-0, PEAR-Flat, or none of these.
Parameters
string[] $extensions: An array where the keys are extension names, and the values are extension types like 'module' or 'theme'.
2 calls to DrupalExtensionAdapter::registerExtensions()
- DrupalExtensionAdapter::registerActiveExtensions in lib/
Adapter/ DrupalExtensionAdapter.php - DrupalExtensionAdapter::registerExtensionsByName in lib/
Adapter/ DrupalExtensionAdapter.php - Register lazy plugins for enabled Drupal modules and themes, assuming that we don't know yet whether they use PSR-0, PEAR-Flat, or none of these.
File
- lib/
Adapter/ DrupalExtensionAdapter.php, line 107
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 registerExtensions(array $extensions) {
$prefix_map = array();
$namespace_map = array();
foreach ($extensions as $name => $type) {
if (empty($this->namespaceBehaviors[$type])) {
// Unsupported extension type, e.g. "theme_engine".
// This can happen if a site was upgraded from Drupal 6.
// See https://drupal.org/comment/8503979#comment-8503979
continue;
}
if (!empty($this->registered[$name])) {
// The extension has already been processed.
continue;
}
$namespace_map['Drupal/' . $name . '/'][$name] = $this->namespaceBehaviors[$type];
$prefix_map[str_replace('_', '/', $name) . '/'][$name] = $this->prefixBehaviors[$type];
$this->registered[$name] = TRUE;
}
$this->namespaceMap
->registerDeepPaths($namespace_map);
$this->prefixMap
->registerDeepPaths($prefix_map);
}