Code coverage for /20081101/modules/color/color.install

Line #Times calledCode
1
<?php
2
/* $Id: color.install,v 1.4 2008/08/31 09:15:12 dries Exp $ */
3
4137
function color_requirements($phase) {
53
  $requirements = array();
6
73
  if ($phase == 'runtime') {
8
    // Check for the PHP GD library.
93
    if (function_exists('imagegd2')) {
103
      $info = gd_info();
113
      $requirements['gd'] = array(
123
        'value' => $info['GD Version'],
13
      );
14
15
      // Check for PNG support.
163
      if (function_exists('imagecreatefrompng')) {
173
        $requirements['gd']['severity'] = REQUIREMENT_OK;
183
      }
19
      else {
200
        $requirements['gd']['severity'] = REQUIREMENT_ERROR;
210
        $requirements['gd']['description'] = t('The GD library for PHP is
enabled, but was compiled without PNG support. Please check the <a
href="@url">PHP image documentation</a> for information on how to correct
this.', array('@url' => 'http://www.php.net/manual/ref.image.php'));
22
      }
233
    }
24
    else {
250
      $requirements['gd'] = array(
260
        'value' => t('Not installed'),
270
        'severity' => REQUIREMENT_ERROR,
280
        'description' => t('The GD library for PHP is missing or outdated.
Please check the <a href="@url">PHP image documentation</a> for information
on how to correct this.', array('@url' =>
'http://www.php.net/manual/ref.image.php')),
29
      );
30
    }
313
    $requirements['gd']['title'] = t('GD library');
323
  }
33
343
  return $requirements;
350
}
36137