Same name and namespace in other branches
  1. 5.0.x advagg_cdn/advagg_cdn.install \advagg_cdn_requirements()
  2. 8.x-3.x advagg_cdn/advagg_cdn.install \advagg_cdn_requirements()
  3. 8.x-4.x advagg_cdn/advagg_cdn.install \advagg_cdn_requirements()

Implements hook_requirements().

Fichier

advagg_cdn/advagg_cdn.install, line 11

Code

function advagg_cdn_requirements($phase) {
    $requirements = [];
    // Ensure translations don't break at install time.
    $t = 't';
    // If not at runtime, return here.
    if ($phase !== 'runtime') {
        return $requirements;
    }
    $description = '';
    if (\Drupal::config('advagg.settings')->get('cache_level') < 0) {
        $description = $t('Will be using the unminified version due to AdvAgg being in Development mode.');
    }
    $requirements['advagg_cdn'] = [
        'title' => $t('AdvAgg CDN'),
        'severity' => REQUIREMENT_OK,
        'value' => $t('OK'),
        'description' => $t('Selected libraries should be coming from the CDN.') . ' ' . $description,
    ];
    return $requirements;
}