You are here

exif.install in Exif 8

Same filename and directory in other branches
  1. 8.2 exif.install
  2. 5 exif.install
  3. 6 exif.install
  4. 7 exif.install

Installation requirements for exif module.

File

exif.install
View source
<?php

/**
 * @file
 * Installation requirements for exif module.
 */

/**
 * Implements hook_requirements().
 *
 * @param string $phase
 *   Indicate in which context the hook is called.
 *
 * @return array
 *   requirements
 */
function exif_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime' || $phase == 'install') {

    // Needed by EXIF.
    if (!function_exists('mb_convert_encoding')) {
      $requirements['mb_convert_encoding'] = [
        'title' => t('Multibyte library is not available'),
        'description' => t('The Function mb_convert_encoding is not available on the system. Please ensure the PHP module named php-mbstring has been installed.'),
        'value' => t('php-mbstring library is not available'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
    if (!function_exists('exif_read_data')) {
      $requirements['exif_read_data'] = [
        'title' => t('EXIF library is not available'),
        'description' => t('The Function exif_read_data is not available on the system. Please ensure the PHP module named EXIF has been installed if you are not using exiftool.'),
        'value' => t('EXIF library is not available'),
        'severity' => REQUIREMENT_WARNING,
      ];
    }
    if (!function_exists('iptcparse')) {
      $requirements['iptcparse'] = [
        'title' => t('IPTC library is not available'),
        'description' => t('The Function iptcparse is not available on the system. Please ensure the PHP module named GD has been installed if you are not using exiftool.'),
        'value' => t('GD library is not available'),
        'severity' => REQUIREMENT_WARNING,
      ];
    }
    if (!function_exists('GetImageSize')) {
      $requirements['GetImageSize'] = [
        'title' => t('Image library is not available'),
        'description' => t('The Function GetImageSize is not available on the system. Please ensure the PHP module named GD has been installed if you are not using exiftool.'),
        'value' => t('GD library is not available'),
        'severity' => REQUIREMENT_WARNING,
      ];
    }
  }
  return $requirements;
}

Functions

Namesort descending Description
exif_requirements Implements hook_requirements().