You are here

protected function ConfigUpdateUiCliService::getDifferentItems in Configuration Update Manager 8

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.

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.

2 calls to ConfigUpdateUiCliService::getDifferentItems()
ConfigUpdateUiCliService::differentReport in config_update_ui/src/ConfigUpdateUiCliService.php
Displays differing config items.
ConfigUpdateUiCliService::revertMultiple in config_update_ui/src/ConfigUpdateUiCliService.php
Reverts multiple config items to extension provided version.

File

config_update_ui/src/ConfigUpdateUiCliService.php, line 351

Class

ConfigUpdateUiCliService
Handles all the logic for commands for various versions of Drush.

Namespace

Drupal\config_update_ui

Code

protected function getDifferentItems($type, $name) {
  list($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;
}