You are here

protected function Updater::executeConfigurationActions in Update helper 2.x

Same name and namespace in other branches
  1. 8 src/Updater.php \Drupal\update_helper\Updater::executeConfigurationActions()

Execute configuration update definitions for configurations.

Parameters

array $update_definitions: List of configurations with update definitions for them.

1 call to Updater::executeConfigurationActions()
Updater::executeUpdate in src/Updater.php
Execute update of configuration from update definitions.

File

src/Updater.php, line 180

Class

Updater
Helper class to update configuration.

Namespace

Drupal\update_helper

Code

protected function executeConfigurationActions(array $update_definitions) {
  foreach ($update_definitions as $configName => $configChange) {
    if ($this
      ->updateConfig($configName, $configChange['update_actions'], $configChange['expected_config'])) {
      $this
        ->logInfo($this
        ->t('Configuration @configName has been successfully updated.', [
        '@configName' => $configName,
      ]));
    }
    else {
      $this
        ->logWarning($this
        ->t('Unable to update configuration for @configName.', [
        '@configName' => $configName,
      ]));
    }
  }
}