-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.php
75 lines (67 loc) · 1.97 KB
/
version.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
66
67
68
69
70
71
72
73
74
75
<link rel="stylesheet" href="/style.css">
<?php
require "./vendor/autoload.php";
require_once "topbar.php";
require_once "configure.php";
?>
<link rel="stylesheet" href='style.css'>
<h1>License</h1>
<pre><code>
<?php
echo file_get_contents("$IP/LICENSE");
?>
</code></pre>
<h1>Software stack</h1>
<?php
echo '<table>';
echo '<thead><tr><th>Software</th><th>Version</th></tr></thead>';
echo '<tbody>';
// Bugkiller
echo '<tr><td><a href="https://github.com/TylerMS887/bugkiller">Bugkiller</a></td><td>' . $bugkiller_version . '</td></tr>';
// PHP
echo '<tr><td><a href="https://php.net">PHP</a></td><td>' . phpversion() . '</td></tr>';
// MySQL
$mysql_version = shell_exec('mysql -V');
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $mysql_version, $version);
echo '<tr><td><a href="https://mysql.com">MySQL</a></td><td>' . $version[0] . '</td></tr>';
// Apache HTTP Server
$apache_version = apache_get_version();
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $apache_version, $version);
echo '<tr><td><a href="https://httpd.apache.org">Apache HTTP Server</a></td><td>' . $version[0] . '</td></tr>';
echo '</tbody>';
echo '</table>';
?>
<h1>Composer packages</h1>
<?php
// Get the list of installed Composer packages.
$packages = shell_exec('composer show -i');
// Split the list of packages into an array.
$packages = explode("\n", $packages);
// Create an HTML table.
echo '<table border="1">';
echo '<thead>';
echo '<tr>';
echo '<th>Package</th>';
echo '<th>Description</th>';
echo '<th>Version</th>';
echo '<th>License</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
// Loop through the list of packages and add them to the table.
foreach ($packages as $package) {
$parts = explode(' ', $package);
$name = $parts[0];
$version = $parts[1];
$description = $parts[2];
$license = $parts[3];
echo '<tr>';
echo '<td>' . $name . '</td>';
echo '<td>' . $description . '</td>';
echo '<td>' . $version . '</td>';
echo '<td>' . $license . '</td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
?>