You are here

public function ConfigSyncLister::getExtensionChangelists in Configuration Synchronizer 8.2

Same name and namespace in other branches
  1. 8 src/ConfigSyncLister.php \Drupal\config_sync\ConfigSyncLister::getExtensionChangelists()

Returns a change list for all installed extensions.

Parameters

array $extension_names: Array with keys of extension types ('module', 'theme') and values arrays of extension names.

Return value

array Associative array of configuration changes keyed by extension type (module or theme) in which values are arrays keyed by extension name.

Overrides ConfigSyncListerInterface::getExtensionChangelists

File

src/ConfigSyncLister.php, line 127

Class

ConfigSyncLister
Provides methods related to listing configuration changes.

Namespace

Drupal\config_sync

Code

public function getExtensionChangelists(array $extension_names = []) {
  $changelist = [];

  // If no extensions were specified, use all installed extensions.
  if (empty($extension_names)) {
    $extension_names = $this
      ->getSyncExtensions();
  }
  foreach ($extension_names as $type => $names) {
    foreach ($names as $name) {
      if ($extension_changelist = $this
        ->getExtensionChangelist($type, $name)) {
        $changelist[$type][$name] = $extension_changelist;
      }
    }
  }
  return $changelist;
}