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