/
info.php
64 lines (47 loc) · 1.35 KB
/
info.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
<?php
namespace Concrete\Controller\SinglePage\Dashboard\System\Environment;
use Concrete\Core\Http\Response;
use Concrete\Core\Page\Controller\DashboardPageController;
use Concrete\Core\System\Info as SystemInfo;
class Info extends DashboardPageController
{
public function get_environment_info()
{
$info = $this->app->make(SystemInfo::class);
$hostname = $info->getHostName();
$environment = $info->getEnvironment();
$dbInfos = '';
if ($info->isInstalled()) {
$dbInfos = "\n# Database Information\nVersion: {$info->getDBMSVersion()}\nSQL Mode: {$info->getDBMSSqlMode()}\n";
}
$packages = $info->getPackages() ?: 'None';
$overrides = $info->getOverrides() ?: 'None';
$phpExtensions = ($info->getPhpExtensions() === false) ? 'Unable to determine' : $info->getPhpExtensions();
$content = <<<EOL
# Concrete Version
{$info->getCoreVersions()}
# Hostname
{$hostname}
# Environment
{$environment}
{$dbInfos}
# Concrete Packages
{$packages}
# Concrete Overrides
{$overrides}
# Concrete Cache Settings
{$info->getCache()}
# Server Software
{$info->getServerSoftware()}
# Server API
{$info->getServerAPI()}
# PHP Version
{$info->getPhpVersion()}
# PHP Extensions
{$phpExtensions}
# PHP Settings
{$info->getPhpSettings()}
EOL;
return new Response($content);
}
}