/**
  * React to new extensions that were just enabled.
  *
  * @param string $name
  * @param string $type
  */
 public function welcomeNewExtension($name, $type)
 {
     if (isset($this->registered[$name])) {
         // Already registered.
         return;
     }
     $dir = $this->system->drupalGetPath($type, $name);
     $this->_registerExtension($name, $dir);
 }
Exemplo n.º 2
0
 /**
  * Runs hook_xautoload() on all enabled modules.
  *
  * This may occur multiple times in a request, if new modules are enabled.
  *
  * @param array $modules
  */
 private function runHookXautoload(array $modules)
 {
     // Let other modules register stuff to the finder via hook_xautoload().
     $adapter = \xautoload_InjectedAPI_hookXautoload::create($this->finder, '');
     foreach ($modules as $module) {
         $adapter->setExtensionDir($dir = $this->system->drupalGetPath('module', $module));
         $function = $module . '_xautoload';
         $function($adapter, $dir);
     }
 }