You are here

protected function LibraryDeriver::getExtensionLocations in UI Patterns 8

Get extension locations.

Return value

array Array of extensions keyed by their path location.

1 call to LibraryDeriver::getExtensionLocations()
LibraryDeriver::getHostExtension in modules/ui_patterns_library/src/Plugin/Deriver/LibraryDeriver.php
Get extension name that hosts the given YAML definition file.

File

modules/ui_patterns_library/src/Plugin/Deriver/LibraryDeriver.php, line 207

Class

LibraryDeriver
Class LibraryDeriver.

Namespace

Drupal\ui_patterns_library\Plugin\Deriver

Code

protected function getExtensionLocations() {

  /** @var \Drupal\Core\Extension\Extension[] $extensions */
  if (empty($this->extensionLocations)) {
    $extensions = $this->extensionDiscovery
      ->scan('theme') + $this->extensionDiscovery
      ->scan('module');
    foreach ($extensions as $name => $extension) {
      $this->extensionLocations[$this->root . DIRECTORY_SEPARATOR . $extension
        ->getPath()] = $name;
    }
  }
  return $this->extensionLocations;
}