Skip to content

Commit 51896e2

Browse files
authored
Merge branch 'master' into feature/symfony5
2 parents 1d667b0 + f06e967 commit 51896e2

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/Controller/InfoController.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ class InfoController extends AbstractController
5656
*/
5757
private $debuggerEnabled;
5858

59+
/**
60+
* @var array
61+
*/
62+
private $systemInfo = [];
63+
5964
public function __construct(
6065
$buildPath,
6166
$environment,
@@ -64,14 +69,19 @@ public function __construct(
6469
$this->buildPath = $buildPath;
6570
$this->environment = $environment;
6671
$this->debuggerEnabled = $debuggerEnabled;
72+
73+
if (function_exists('opcache_get_status')) {
74+
$this->systemInfo['opcache'] = opcache_get_status(false);
75+
}
6776
}
6877

6978
public function __invoke(): JsonResponse
7079
{
7180
$info = Information::buildFrom(
7281
BuildPathFactory::buildFrom($this->buildPath),
7382
$this->environment,
74-
$this->debuggerEnabled
83+
$this->debuggerEnabled,
84+
$this->systemInfo
7585
);
7686

7787
return $this->json($info);

src/Value/Information.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ class Information implements JsonSerializable
4040
* @var bool
4141
*/
4242
private $debuggerEnabled;
43+
4344
/**
4445
* @var array
4546
*/
4647
private $systemInfo;
47-
48+
49+
4850
public static function buildFrom(BuildPath $buildPath, string $environment, bool $debuggerEnabled, array $systemInfo): Information
4951
{
5052
Assert::stringNotEmpty($environment, 'Environment must have a non empty string value');
@@ -60,13 +62,15 @@ public function __construct(BuildPath $buildPath, string $environment, bool $deb
6062
$this->debuggerEnabled = $debuggerEnabled;
6163
$this->systemInfo = $systemInfo;
6264
}
65+
6366

6467
public function jsonSerialize(): array
6568
{
6669
$information = [
6770
'build' => $this->buildPath->getPath(),
6871
'env' => $this->environment,
6972
'debug' => $this->debuggerEnabled,
73+
'system' => $this->systemInfo,
7074
];
7175

7276
if ($this->buildPath->hasRevision()) {

0 commit comments

Comments
 (0)