1 | 85 | simandl | <?php |
2 | | | if(isset($argv)) |
3 | | | { |
4 | | | $env = "CLI"; |
5 | | | } |
6 | | | else |
7 | | | { |
8 | | | $env = "WEB"; |
9 | | | } |
10 | | | |
11 | | | print wordwrap("Some version of the GD graphics library have a bug in their handling of Alpha channels. Unfortunately, Weathermap uses these to draw Nodes."); |
12 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
13 | | | |
14 | | | print wordwrap("This program will test if your PHP installation is using a buggy GD library."); |
15 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
16 | | | |
17 | | | print wordwrap("If you are, you should either use PHP's built-in (aka 'bundled') GD library, or update to GD Version 2.0.34 or newer. Weathermap REQUIRES working Alpha support."); |
18 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
19 | | | |
20 | | | print wordwrap("Let's see if you have the GD transparency bug..."); |
21 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
22 | | | print wordwrap("If you see no more output, or a segfault, then you do, and you'll need to upgrade."); |
23 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
24 | | | print wordwrap("If you get other errors, like 'undefined function', then run check.php to\nmake sure that your PHP installation is otherwise OK."); |
25 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
26 | | | print "Here we go..."; |
27 | | | print ($env=='CLI'?"\n\n":"\n<p>"); |
28 | | | |
29 | | | // make sure even the affected folks can see the explanation |
30 | | | ob_flush(); |
31 | | | flush(); |
32 | | | |
33 | | | $temp_width = 10; |
34 | | | $temp_height = 10; |
35 | | | |
36 | | | $node_im=imagecreatetruecolor($temp_width,$temp_height ); |
37 | | | imageSaveAlpha($node_im, TRUE); |
38 | | | $nothing=imagecolorallocatealpha($node_im,128,0,0,127); |
39 | | | imagefill($node_im, 0, 0, $nothing); |
40 | | | imagedestroy($node_im); |
41 | | | |
42 | | | print "...nope. We got past the risky part, so that's good.\nYour GD library looks healthy.\n"; |
43 | | | print ($env=='CLI'?"\n":"\n<p>"); |
44 | | | ?> |