You are here

function hijri_requirements in Hijri 3.0.x

Same name and namespace in other branches
  1. 1.0.x hijri.install \hijri_requirements()

Implements hook_requirements().

File

./hijri.install, line 11
Installation file.

Code

function hijri_requirements($phase) {
  $requirements = [];
  if ($phase == "runtime") {
    $requirements['hijri'] = [
      'title' => t('arutil/ar-php library'),
    ];
    if (class_exists('ArUtil\\I18N\\Date')) {
      $requirements['hijri']['value'] = t('Installed');
      $requirements['hijri']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['hijri']['value'] = t('Not installed');
      $requirements['hijri']['severity'] = REQUIREMENT_ERROR;
      $requirements['hijri']['description'] = t('Please install <a href="@arutil">arutil/ar-php</a> library.', [
        '@arutil' => 'https://packagist.org/packages/arutil/ar-php',
      ]);
    }
  }
  return $requirements;
}