You are here

hijri.install in Hijri 1.0.x

Same filename and directory in other branches
  1. 8 hijri.install
  2. 7 hijri.install
  3. 3.0.x hijri.install

Installation file.

File

hijri.install
View source
<?php

/**
 * @file
 * Installation file.
 */

/**
 * Implements hook_requirements().
 */
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;
}

Functions

Namesort descending Description
hijri_requirements Implements hook_requirements().