crowdriff_api-1.x-dev/crowdriff_api.install

crowdriff_api.install
<?php

/**
 * @file
 * crowdriff_api.install
 */

use Drupal\Core\Url;

/**
 * Implements hook_requirements().
 */
function crowdriff_api_requirements($phase): array {
  $requirements = [];
  if ($phase == 'runtime') {
    /** @var \Drupal\crowdriff_api\CrowdriffService $crowdriffService */
    $crowdriffService = \Drupal::service('crowdriff_api.crowdriff_service');
    if (empty($crowdriffService->getConfig()->get('api_key_name'))) {
      $requirements['crowdriff'] = [
        'title' => t('Crowdriff API Key'),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('Crowdriff API is not configured. Please set API key on the Crowdriff <a href=":link">settings page</a>.', [
          ':link' => Url::fromRoute('crowdriff_api.config_form')->toString(),
        ]),
      ];
    }
  }
  return $requirements;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc