add web server stat
This commit is contained in:
parent
80b0032e2b
commit
4d5066d118
1 changed files with 27 additions and 1 deletions
|
@ -109,6 +109,31 @@ class Utils
|
|||
return $modules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get server software and version.
|
||||
*
|
||||
* @return array<string,string> The server info
|
||||
*/
|
||||
public static function getServer(): array
|
||||
{
|
||||
$res = [
|
||||
'name' => 'undefined',
|
||||
'version' => 'undefined',
|
||||
];
|
||||
|
||||
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
|
||||
$exp = explode('/', $_SERVER['SERVER_SOFTWARE']);
|
||||
if (count($exp) == 2) {
|
||||
$res = [
|
||||
'name' => $exp[0],
|
||||
'version' => $exp[1],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report contents.
|
||||
*
|
||||
|
@ -329,7 +354,8 @@ class Utils
|
|||
'core' => [
|
||||
'version' => DC_VERSION,
|
||||
],
|
||||
'php' => [
|
||||
'server' => self::getServer(),
|
||||
'php' => [
|
||||
'sapi' => php_sapi_name() ?: 'php',
|
||||
'version' => phpversion(),
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue