Example #1
0
 /**
  * @return \Drupal\Core\Extension\Extension[]
  */
 private function discoverModules()
 {
     /*
      * @todo Remove DrupalExtensionDiscovery subclass once
      * https://www.drupal.org/node/2503927 is fixed.
      */
     $discovery = new DrupalExtensionDiscovery(\Drupal::root());
     $discovery->reset();
     return $discovery->scan('module');
 }
Example #2
0
 /**
  * @param string $type
  * @return \Drupal\Core\Extension\Extension[]
  */
 public function discoverExtensions($type = 'module')
 {
     $this->getDrupalHelper()->loadLegacyFile('/core/modules/system/system.module');
     system_rebuild_module_data();
     /*
      * @see Remove DrupalExtensionDiscovery subclass once
      * https://www.drupal.org/node/2503927 is fixed.
      */
     $discovery = new DrupalExtensionDiscovery(\Drupal::root());
     $discovery->reset();
     return $discovery->scan($type);
 }
Example #3
0
 /**
  * @param string $moduleName
  * @return string
  */
 public function getModulePath($moduleName)
 {
     if (!$this->modulePath) {
         /*
          * @todo Remove DrupalExtensionDiscovery subclass once
          * https://www.drupal.org/node/2503927 is fixed.
          */
         $discovery = new DrupalExtensionDiscovery(\Drupal::root());
         $discovery->reset();
         $result = $discovery->scan('module');
         $this->modulePath = DRUPAL_ROOT . '/' . $result[$moduleName]->getPath();
     }
     return $this->modulePath;
 }