You are here

function demo_umami_requirements in Drupal 10

Same name and namespace in other branches
  1. 8 core/profiles/demo_umami/demo_umami.install \demo_umami_requirements()
  2. 9 core/profiles/demo_umami/demo_umami.install \demo_umami_requirements()

Implements hook_requirements().

File

core/profiles/demo_umami/demo_umami.install, line 14
Install, update and uninstall functions for the demo_umami installation profile.

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;
}