function demo_umami_requirements

Same name in other branches
  1. 9 core/profiles/demo_umami/demo_umami.install \demo_umami_requirements()
  2. 10 core/profiles/demo_umami/demo_umami.install \demo_umami_requirements()
  3. 11.x core/profiles/demo_umami/demo_umami.install \demo_umami_requirements()

Implements hook_requirements().

File

core/profiles/demo_umami/demo_umami.install, line 14

Code

function demo_umami_requirements($phase) {
    $requirements = [];
    if ($phase == 'runtime') {
        $profile = \Drupal::installProfile();
        $info = \Drupal::service('extension.list.profile')->getExtensionInfo($profile);
        $requirements['experimental_profile_used'] = [
            'title' => t('Experimental installation profile used'),
            'value' => $info['name'],
            'description' => t('Experimental profiles are provided for testing purposes only. Use at your own risk. To start building a new site, reinstall Drupal and choose a non-experimental profile.'),
            'severity' => REQUIREMENT_WARNING,
        ];
    }
    return $requirements;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.