You are here

function bakery_requirements in Bakery Single Sign-On System 7.4

Implements hook_requirements().

File

./bakery.install, line 55

Code

function bakery_requirements($phase) {
  if ($phase != 'runtime') {
    return;
  }
  $t = get_t();
  $requirement = [
    'title' => $t('Bakery'),
    'value' => $t('OK'),
  ];
  if (!class_exists('\\Lcobucci\\JWT\\Token')) {
    $requirement['value'] = $t('library not found');
    $requirement['description'] = $t("You should run 'composer install' to download the JWT library from https://github.com/lcobucci/jwt.");
    $requirement['severity'] = REQUIREMENT_ERROR;
  }
  return [
    'bakery' => $requirement,
  ];
}