You are here

function siteimprove_install in Siteimprove 8

Same name and namespace in other branches
  1. 7 siteimprove.install \siteimprove_install()

Implements hook_install().

File

./siteimprove.install, line 11
Install file for the siteimprove module.

Code

function siteimprove_install() {

  // Request new token.
  if ($token = \Drupal::service('siteimprove.utils')
    ->requestToken()) {

    /** @var \Drupal\Core\Config\Config $config */
    $config = \Drupal::service('config.factory')
      ->getEditable('siteimprove.settings');
    $config
      ->set('token', $token);
    $config
      ->save();
  }
  else {
    \Drupal::messenger()
      ->addError(t('There was an error requesting a new token.'));
  }

  // Set default domain plugin id.
  siteimprove_update_8101();

  // Set other settings.
  siteimprove_update_8102();
}