You are here

public function LocaleDefaultConfigStorage::getComponentNames in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::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 Configuration names provided by that component. In case of language module this list is extended with configured languages that have predefined names as well.

File

core/modules/locale/src/LocaleDefaultConfigStorage.php, line 127

Class

LocaleDefaultConfigStorage
Provides access to default configuration for locale integration.

Namespace

Drupal\locale

Code

public function getComponentNames($type, array $list) {
  $names = array_unique(array_merge(array_keys($this->requiredInstallStorage
    ->getComponentNames($type, $list)), array_keys($this->optionalInstallStorage
    ->getComponentNames($type, $list))));
  if ($type == 'module' && in_array('language', $list)) {
    $languages = $this
      ->predefinedConfiguredLanguages();
    $names = array_unique(array_merge($names, $languages));
  }
  return $names;
}