You are here

acquia_lift.install in Acquia Lift Connector 8

Installation file for Acquia Lift module.

File

acquia_lift.install
View source
<?php

/**
 * @file
 * Installation file for Acquia Lift module.
 */
use Drupal\acquia_lift\Service\Helper\SettingsHelper;
use Drupal\Core\Url;

/**
 * Implements hook_requirements().
 */
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;
}

Functions

Namesort descending Description
acquia_lift_requirements Implements hook_requirements().