You are here

function akamai_requirements in Akamai 8

Same name and namespace in other branches
  1. 8.3 akamai.install \akamai_requirements()
  2. 6 akamai.install \akamai_requirements()
  3. 7 akamai.install \akamai_requirements()

Implementation of hook_requirements().

File

./akamai.install, line 6

Code

function akamai_requirements($phase) {
  $akamai_config = \Drupal::config('akamai.settings');
  $requirements = array();
  $requirements['SoapClient']['title'] = t('SoapClient class');
  if (!class_exists('SoapClient')) {
    $requirements['SoapClient']['value'] = t('Not installed');
    $requirements['SoapClient']['severity'] = REQUIREMENT_ERROR;
    $requirements['SoapClient']['description'] = t('The SoapClient library is not installed. Either install the php-soap extension, or otherwise make the library available to PHP.');
  }
  else {
    $requirements['SoapClient']['value'] = t('Installed');
    $requirements['SoapClient']['severity'] = REQUIREMENT_OK;
  }

  // Check is REST API is set as default, otherwise raise error
  if (!$akamai_config
    ->get('restapi_default')) {
    $requirements['rest_default']['title'] = t('Akamai using REST');
    $requirements['rest_default']['value'] = t('REST not set as default method');
    $requirements['rest_default']['severity'] = REQUIREMENT_WARNING;
    $requirements['rest_default']['description'] = t('REST is not set as the default method for issuing Akamai cache clears. Akamai has said that they will sunset SOAP support June 1 2014.');
  }
  return $requirements;
}