| 1 | | <?php |
| 2 | | /* $Id: color.install,v 1.4 2008/08/31 09:15:12 dries Exp $ */ |
| 3 | | |
| 4 | 137 | function color_requirements($phase) { |
| 5 | 3 | $requirements = array(); |
| 6 | | |
| 7 | 3 | if ($phase == 'runtime') { |
| 8 | | // Check for the PHP GD library. |
| 9 | 3 | if (function_exists('imagegd2')) { |
| 10 | 3 | $info = gd_info(); |
| 11 | 3 | $requirements['gd'] = array( |
| 12 | 3 | 'value' => $info['GD Version'], |
| 13 | | ); |
| 14 | | |
| 15 | | // Check for PNG support. |
| 16 | 3 | if (function_exists('imagecreatefrompng')) { |
| 17 | 3 | $requirements['gd']['severity'] = REQUIREMENT_OK; |
| 18 | 3 | } |
| 19 | | else { |
| 20 | 0 | $requirements['gd']['severity'] = REQUIREMENT_ERROR; |
| 21 | 0 | $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 | | } |
| 23 | 3 | } |
| 24 | | else { |
| 25 | 0 | $requirements['gd'] = array( |
| 26 | 0 | 'value' => t('Not installed'), |
| 27 | 0 | 'severity' => REQUIREMENT_ERROR, |
| 28 | 0 | '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 | | } |
| 31 | 3 | $requirements['gd']['title'] = t('GD library'); |
| 32 | 3 | } |
| 33 | | |
| 34 | 3 | return $requirements; |
| 35 | 0 | } |
| 36 | 137 | |