You are here

protected function ExtensionDiscovery::getSiteDirectories in Composer Manager 8

Returns an array of all site directories.

Return value

array An array of site directories. For example: ['default', 'test.site.com']. Doesn't include the 'all' directory since it doesn't represent a site.

1 call to ExtensionDiscovery::getSiteDirectories()
ExtensionDiscovery::scan in src/ExtensionDiscovery.php
Overrides BaseExtensionDiscovery::scan().

File

src/ExtensionDiscovery.php, line 75

Class

ExtensionDiscovery
Discovers available extensions in the filesystem.

Namespace

Drupal\composer_manager

Code

protected function getSiteDirectories() {
  $site_directories = scandir($this->root . '/sites');
  $site_directories = array_filter($site_directories, function ($site_directory) {
    $is_directory = is_dir($this->root . '/sites/' . $site_directory);
    $not_hidden = substr($site_directory, 0, 1) != '.';
    $not_all = $site_directory != 'all';
    return $is_directory && $not_hidden && $not_all;
  });
  return $site_directories;
}