-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebserver_test.php
65 lines (50 loc) · 1.47 KB
/
webserver_test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
$php_minimum_version_array = array(5, 2, 0);
$curl_minimum_version_array = array(7, 10, 5);
echo 'Does the server use a supported PHP version? ';
$php_current_version = phpversion();
$php_current_version_array = explode('.', $php_current_version);
$minimum_php_version_supported = false;
for($i = 0; $i < 3; $i++) {
if(intval($php_current_version_array[$i], 10) > $php_minimum_version_array[$i]) {
$minimum_php_version_supported = true;
break;
} else if(intval($php_current_version_array[$i], 10) == $php_minimum_version_array[$i]) {
if($i == 2) {
$minimum_php_version_supported = true;
}
} else {
break;
}
}
if($minimum_php_version_supported) {
echo 'Yes'.PHP_EOL.PHP_EOL;
} else {
echo 'No'.PHP_EOL.PHP_EOL;
}
echo 'Does the server use a supported cURL version? ';
if(is_array(curl_version())) {
$curl_current_version = curl_version()['version'];
$curl_current_version_array = explode('.', $curl_current_version);
$minimum_curl_version_supported = false;
for($i = 0; $i < 3; $i++) {
if(intval($curl_current_version_array[$i], 10) > $curl_minimum_version_array[$i]) {
$minimum_curl_version_supported = true;
break;
} else if(intval($curl_current_version_array[$i], 10) == $curl_minimum_version_array[$i]) {
if($i == 2) {
$minimum_curl_version_supported = true;
}
} else {
break;
}
}
if($minimum_curl_version_supported) {
echo 'Yes'.PHP_EOL.PHP_EOL;
} else {
echo 'No'.PHP_EOL.PHP_EOL;
}
} else {
echo 'No';
}
echo PHP_EOL;