You are here

function trailing_slash_requirements in Trailing Slash 8

Implements hook_requirements().

File

./trailing_slash.install, line 16

Code

function trailing_slash_requirements($phase) {
  $requirements = [];
  $requirements['php'] = [
    'title' => t('PHP'),
    'value' => TRAILING_SLASH_MINIMUM_PHP,
  ];
  if (version_compare(phpversion(), TRAILING_SLASH_MINIMUM_PHP) < 0) {
    $requirements['php']['description'] = t('Your PHP installation is too old. This module requires at least PHP %version.', [
      '%version' => TRAILING_SLASH_MINIMUM_PHP,
    ]);
    $requirements['php']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}