protected function FarmUpdate::getDifferentItems in farmOS 2.x
Lists differing config items.
Lists config items that differ from the versions provided by your installed modules, themes, or install profile. See config-diff to show what the differences are.
This method is copied directly from ConfigUpdateUiCliService.
Parameters
string $type: Run the report for: module, theme, profile, or "type" for config entity type.
string $name: The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.
Return value
array An array of differing configuration items.
See also
\Drupal\config_update_ui\ConfigUpdateUiCliService::getDifferentItems()
1 call to FarmUpdate::getDifferentItems()
- FarmUpdate::rebuild in modules/
core/ update/ src/ FarmUpdate.php - Rebuild farmOS configuration.
File
- modules/
core/ update/ src/ FarmUpdate.php, line 175
Class
- FarmUpdate
- Farm update service.
Namespace
Drupal\farm_updateCode
protected function getDifferentItems($type, $name) {
[
$activeList,
$installList,
$optionalList,
] = $this->configList
->listConfig($type, $name);
$addedItems = array_diff($activeList, $installList, $optionalList);
$activeAndAddedItems = array_diff($activeList, $addedItems);
$differentItems = [];
foreach ($activeAndAddedItems as $name) {
$active = $this->configUpdate
->getFromActive('', $name);
$extension = $this->configUpdate
->getFromExtension('', $name);
if (!$this->configDiff
->same($active, $extension)) {
$differentItems[] = $name;
}
}
sort($differentItems);
return $differentItems;
}