You are here

function twig_extensions_requirements in Twig Extensions 8

Same name and namespace in other branches
  1. 8.2 twig_extensions.install \twig_extensions_requirements()

Implements hook_requirements().

File

./twig_extensions.install, line 6

Code

function twig_extensions_requirements($phase) {
  $requirements = [];
  if (!class_exists('IntlDateFormatter')) {
    $requirements['twig_extensions_intl']['title'] = t('Twig Extensions Intl');
    $requirements['twig_extensions_intl']['description'] = t('Twig Extensions Intl is not active because the <a href=":intl_url">PHP Extension</a> is not installed. While not needed with Drupal having similar functionality, it may be desired.', [
      ':intl_url' => 'http://php.net/manual/en/book.intl.php',
    ]);
    $requirements['twig_extensions_intl']['severity'] = REQUIREMENT_INFO;
  }
  return $requirements;
}