public function ConfigSyncLister::getExtensionChangelists in Configuration Synchronizer 8
Same name and namespace in other branches
- 8.2 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 90
Class
- ConfigSyncLister
- Provides methods related to listing configuration changes.
Namespace
Drupal\config_syncCode
public function getExtensionChangelists(array $extension_names = []) {
$changelist = [];
// If no extensions were specified, use all installed extensions.
if (empty($extension_names)) {
$installed_extensions = $this->activeStorage
->read('core.extension');
foreach (array(
'module',
'theme',
) as $type) {
if (!empty($installed_extensions[$type])) {
$extension_names[$type] = array_keys($installed_extensions[$type]);
}
}
}
foreach ($extension_names as $type => $names) {
foreach ($names as $name) {
if ($extension_changelist = $this
->getExtensionChangelist($type, $name)) {
if (!isset($changelist[$type])) {
$changelist[$type] = [];
}
$changelist[$type][$name] = $extension_changelist;
}
}
}
return $changelist;
}