You are here

public function AcsfDuplicationScrubConfigurationHandler::handle in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 src/Event/AcsfDuplicationScrubConfigurationHandler.php \Drupal\acsf\Event\AcsfDuplicationScrubConfigurationHandler::handle()

Implements AcsfEventHandler::handle().

Overrides AcsfEventHandler::handle

File

src/Event/AcsfDuplicationScrubConfigurationHandler.php, line 20

Class

AcsfDuplicationScrubConfigurationHandler
Handles the scrubbing of Drupal core state / configuration.

Namespace

Drupal\acsf\Event

Code

public function handle() {
  $this
    ->consoleLog(dt('Entered @class', [
    '@class' => get_class($this),
  ]));

  // Delete selected state values.
  $variables = [
    // The Acquia Connector module puts the below values in the state system
    // (because it's a general module, not only running on Acquia Hosting
    // infrastructure) but our actual authoritative values are in an include
    // file from Hosting, e.g. D8-<hosting_site>-common-settings.inc:
    // $config['ah_network_key'] and $config['ah_network_identifier']. So we
    // need to clear them here because they are stale after we do a cross-
    // sitegroup duplication. (Hosting/ACE has no method for this because only
    // ACSF ever does cross-sitegroup site copies.)
    'acquia_connector.identifier',
    'acquia_connector.key',
    'node.min_max_update_time',
    'system.cron_last',
    'system.private_key',
  ];
  $state_storage = \Drupal::state();
  foreach ($variables as $name) {
    $state_storage
      ->delete($name);
  }
}