Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / color / color.install
1 <?php
2
3 /**
4  * @file
5  * Install, update and uninstall functions for the color module.
6  */
7
8 /**
9  * Implements hook_requirements().
10  */
11 function color_requirements($phase) {
12   $requirements = [];
13
14   if ($phase == 'runtime') {
15     // Check for the PHP GD library.
16     if (function_exists('imagegd2')) {
17       $info = gd_info();
18       $requirements['color_gd'] = [
19         'value' => $info['GD Version'],
20       ];
21
22       // Check for PNG support.
23       if (!function_exists('imagecreatefrompng')) {
24         $requirements['color_gd']['severity'] = REQUIREMENT_WARNING;
25         $requirements['color_gd']['description'] = t('The GD library for PHP is enabled, but was compiled without PNG support. Check the <a href="http://php.net/manual/ref.image.php">PHP image documentation</a> for information on how to correct this.');
26       }
27     }
28     else {
29       $requirements['color_gd'] = [
30         'value' => t('Not installed'),
31         'severity' => REQUIREMENT_ERROR,
32         'description' => t('The GD library for PHP is missing or outdated. Check the <a href="http://php.net/manual/book.image.php">PHP image documentation</a> for information on how to correct this.'),
33       ];
34     }
35     $requirements['color_gd']['title'] = t('GD library PNG support');
36   }
37
38   return $requirements;
39 }