You are here

function taxonomy_image_requirements in Taxonomy Image 6

Same name and namespace in other branches
  1. 5 taxonomy_image.install \taxonomy_image_requirements()

Implementation of hook_requirements().

File

./taxonomy_image.install, line 13
taxonomy_image.install. Simple module for providing an association between taxonomy terms and images. Written by Jeremy Andrews <jeremy@kerneltrap.org>, May 2004.

Code

function taxonomy_image_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();

  // Check for GD support.
  if (extension_loaded('gd')) {
    $gd = gd_info();
    $gd_vers = $gd['GD Version'];
    unset($gd['GD Version']);
    if ($gd['FreeType Support']) {
      $gd['FreeType Support' . ' ' . $gd['FreeType Linkage']] = 1;
      unset($gd['FreeType Support'], $gd['FreeType Linkage']);
    }
    $requirements['gd'] = array(
      // D6 already has a GD check, just add the description.
      'description' => '<small>' . implode(', ', array_keys(array_filter($gd))) . '</small>',
    );
  }
  else {
    $requirements['ti'] = array(
      'title' => $t('Image functions (GD)'),
      'value' => $t('Disabled'),
      'description' => $t('The Taxonomy Image module requires that you configure PHP with GD support.'),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}