You are here

function akamai_update_8005 in Akamai 8.3

Decommission CCUv2.

File

./akamai.install, line 72
Contains install and update functionality for Akamai.

Code

function akamai_update_8005() {
  $version = \Drupal::config('akamai.settings')
    ->get('version');
  if ($version !== 'v3') {
    \Drupal::logger('akamai')
      ->warning('Please note: Akamai have deprecated CCUv2, the Akamai module now (currently) only supports CCUv3.');
    \Drupal::service('config.factory')
      ->getEditable('akamai.settings')
      ->set('version', 'v3')
      ->save();
  }

  // Delete old configs.
  \Drupal::service('config.factory')
    ->getEditable('akamai.settings.action_v2')
    ->delete();
  \Drupal::service('config.factory')
    ->getEditable('akamai.settings.status_expire')
    ->delete();
  \Drupal::service('config.factory')
    ->getEditable('number_of_logs_to_delete')
    ->delete();

  // Remove status logs.
  \Drupal::state()
    ->delete('akamai.purge_status');
}