You are here

protected function LibraryDeriver::getDirectories in UI Patterns 8

Create a list of all directories to scan.

This includes all module directories and directories of the default theme and all of its possible base themes.

Return value

array An array containing directory paths keyed by their extension name.

1 call to LibraryDeriver::getDirectories()
LibraryDeriver::getPatterns in modules/ui_patterns_library/src/Plugin/Deriver/LibraryDeriver.php
Get pattern definition objects.

File

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

Class

LibraryDeriver
Class LibraryDeriver.

Namespace

Drupal\ui_patterns_library\Plugin\Deriver

Code

protected function getDirectories() {
  $default_theme = $this->themeHandler
    ->getDefault();
  $base_themes = $this->themeHandler
    ->getBaseThemes($this->themeHandler
    ->listInfo(), $default_theme);
  $theme_directories = $this->themeHandler
    ->getThemeDirectories();
  $directories = [];
  if (isset($theme_directories[$default_theme])) {
    $directories[$default_theme] = $theme_directories[$default_theme];
    foreach ($base_themes as $name => $theme) {
      $directories[$name] = $theme_directories[$name];
    }
  }
  return $directories + $this->moduleHandler
    ->getModuleDirectories();
}