Line # | Frequency | Source Line |
1 | | <?php |
2 | | /* $Id: color.install,v 1.2 2006/12/05 05:49:50 dries Exp $ */ |
3 | |
|
4 | | function color_requirements($phase) { |
5 | | $requirements = array(); |
6 | |
|
7 | | if ($phase == 'runtime') { |
8 | | // Check GD library |
9 | | if (function_exists('imagegd2')) { |
10 | | $info = gd_info(); |
11 | | $requirements['gd'] = array( |
12 | | 'value' => $info['GD Version'], |
13 | | ); |
14 | |
|
15 | | // Check PNG support |
16 | | if (function_exists('imagecreatefrompng')) { |
17 | | $requirements['gd']['severity'] = REQUIREMENT_OK; |
18 | | } |
19 | | else { |
20 | | $requirements['gd']['severity'] = REQUIREMENT_ERROR; |
21 | | $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/en/ref.image.php')); |
22 | | } |
23 | | } |
24 | | else { |
25 | | $requirements['gd'] = array( |
26 | | 'value' => t('Not installed'), |
27 | | 'severity' => REQUIREMENT_ERROR, |
28 | | '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/en/ref.image.php')), |
29 | | ); |
30 | | } |
31 | | $requirements['gd']['title'] = t('GD library'); |
32 | | } |
33 | |
|
34 | | return $requirements; |
35 | | } |