You are here

function acquia_connector_update_8005 in Acquia Connector 8

Move Acquia Subscription credentials into State.

Remove Acquia Subscription credentials from the config and place it into the State storage. For more info see https://www.drupal.org/node/2635138.

File

./acquia_connector.install, line 267
Install, update, and uninstall functions for the Acquia Connector module.

Code

function acquia_connector_update_8005() {
  $config = \Drupal::configFactory()
    ->getEditable('acquia_connector.settings');
  $storage = new Storage();
  if ($config
    ->get('key')) {
    $storage
      ->setKey($config
      ->get('key'));
    $config
      ->clear('key');
  }
  if ($config
    ->get('identifier')) {
    $storage
      ->setIdentifier($config
      ->get('identifier'));
    $config
      ->clear('identifier');
  }
  $config
    ->save(TRUE);
}