You are here

function acquia_lift_requirements in Acquia Lift Connector 8

Same name and namespace in other branches
  1. 8.4 acquia_lift.install \acquia_lift_requirements()
  2. 8.3 acquia_lift.install \acquia_lift_requirements()
  3. 7 acquia_lift.install \acquia_lift_requirements()
  4. 7.2 acquia_lift.install \acquia_lift_requirements()

Implements hook_requirements().

File

./acquia_lift.install, line 14
Installation file for Acquia Lift module.

Code

function acquia_lift_requirements($phase) {
  $requirements = [];
  if ($phase !== 'runtime') {
    return $requirements;
  }
  $credentialSettings = \Drupal::config('acquia_lift.settings')
    ->get('credential');
  if (!SettingsHelper::isInvalidCredential($credentialSettings)) {
    return $requirements;
  }
  $requirements['acquia_lift_credential'] = [
    'title' => t('Acquia Lift module'),
    'description' => t('Acquia Lift module has not been fully configured yet. Please configure its settings from the <a href=":url">Acquia Lift settings page</a>.', [
      ':url' => Url::fromRoute('acquia_lift.admin_settings_form')
        ->toString(),
    ]),
    'severity' => REQUIREMENT_WARNING,
    'value' => t('Incomplete or invalid credential'),
  ];
  return $requirements;
}