public function InstallStorage::getComponentNames

Get all configuration names and folders for a list of modules or themes.

Parameters

string $type: Type of components: 'module' | 'theme' | 'profile'

array $list: Array of theme or module names.

Return value

array Folders indexed by configuration name.

1 call to InstallStorage::getComponentNames()
InstallStorage::getAllFolders in drupal/core/lib/Drupal/Core/Config/InstallStorage.php
Returns a map of all config object names and their folders.

File

drupal/core/lib/Drupal/Core/Config/InstallStorage.php, line 131
Contains Drupal\Core\Config\InstallStorage.

Class

InstallStorage
Storage controller used by the Drupal installer.

Namespace

Drupal\Core\Config

Code

public function getComponentNames($type, array $list) {
  $extension = '.' . $this
    ->getFileExtension();
  $folders = array();
  foreach ($list as $name) {
    $directory = $this
      ->getComponentFolder($type, $name);
    if (file_exists($directory)) {
      $files = glob($directory . '/*' . $extension);
      foreach ($files as $filename) {
        $name = basename($filename, $extension);
        $folders[$name] = $directory;
      }
    }
  }
  return $folders;
}