forked from splitbrain/docker-phpfarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextensions.php
49 lines (45 loc) · 1.06 KB
/
extensions.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
<?php
/**
* This builds the table of supported PHP extensions
*/
$ports=array(8052,8053,8054,8055,8056,8070);
# fetch extension info
$allmods = array();
foreach($ports as $k => $port) {
$mods = @file("http://localhost:$port/?modules");
if(!$mods || substr(trim($mods[0]),0,1) == '<') {
# not the response we're looking for
unset($ports[$k]);
continue;
}
foreach($mods as $mod) {
$mod = trim($mod);
if($mod == 'core') continue;
$allmods[$mod][$port] = 1;
}
}
$ports = array_values($ports);
ksort($allmods);
# build table header
printf(' %10s ', 'Extension');
foreach($ports as $port) {
echo '| PHP '.substr($port,2,1).'.'.substr($port,3,1).' ';
}
echo "\n ";
echo '------------';
foreach($ports as $port) {
echo '+---------';
}
echo "\n";
# output table
foreach($allmods as $mod => $inf) {
printf(' %10s ', $mod);
foreach($ports as $port) {
if(isset($inf[$port])) {
echo '| ✓ ';
} else {
echo '| ';
}
}
echo "\n";
}