also prevent it in .htacces. You may want to add this to one of your files in /etc...
[mailer.git] / contrib / autoreg_test.php
1 <?php
2 /**
3  * Test script for checking all requirements and optional PHP extensions for
4  * ext-autoreg. This is public domain software because I don't care what you do
5  * with it.
6  *
7  * If this script sets your computer on fire or eats your children, it is your
8  * OWN risk to use this software, but it may not do this.
9  */
10
11 // Init counter variables
12 $good = 0;
13 $bad = 0;
14
15 // Check for required base64_encode function
16 if (function_exists('base64_encode')) {
17         // Required function exist
18         print basename(__FILE__) . ': BASE-64 support detected. <font color="green">Good!</font><br />';
19         $good++;
20 } else {
21         print basename(__FILE__) . ': BASE-64 support <strong>NOT</strong> detected. <font color="red">Failed!</font> :-(<br />';
22         $bad++;
23 }
24
25 // Check for required urlencode function
26 if (function_exists('urlencode')) {
27         // Required function exist
28         print basename(__FILE__) . ': URL encode support detected. <font color="green">Good!</font><br />';
29         $good++;
30 } else {
31         print basename(__FILE__) . ': URL encode support <strong>NOT</strong> detected. <font color="red">Failed!</font> :-(<br />';
32         $bad++;
33 }
34
35 // Check for required gzcompress function
36 if (function_exists('gzcompress')) {
37         // Required function exist
38         print basename(__FILE__) . ': GZIP support detected. <font color="green">Good!</font><br />';
39         $good++;
40 } else {
41         print basename(__FILE__) . ': GZIP support <strong>NOT</strong> detected. <font color="red">Failed!</font> :-(<br />';
42         $bad++;
43 }
44
45 // Check for optional mcrypt_encrypt() function
46 if (function_exists('mcrypt_encrypt')) {
47         // Optional function found, good!
48         print basename(__FILE__) . ': mcrypt support detected. <font color="green">Good</font>!<br />';
49         $good++;
50 } else {
51         // Not detected, not bad but would be good to have
52         print basename(__FILE__) . ': mcrypt support <strong>NOT</strong> detected. <font color="yellow">Fix me!</font><br />';
53 }
54
55 // Output total result
56 print '<br />';
57 print 'Analysis summary: good=' . $good . ', bad=' . $bad . '<br />';
58 print '<br />';
59 print 'Result: ';
60
61 // Is something missing?
62 if ($bad > 0) {
63         // Some required functions not found!
64         print '<font color="red">Failed!</<font>';
65 } else {
66         // All fine
67         print '<font color="green">Passed!</font>';
68 }
69
70 // [EOF]
71 ?>