Release 2.53 (#5878)
This commit is contained in:
@@ -26,19 +26,6 @@ use Symfony\Contracts\Cache\ItemInterface;
|
||||
#[IsGranted('system_information')]
|
||||
final class DoctorController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* Required PHP extensions for Kimai.
|
||||
*/
|
||||
public const REQUIRED_EXTENSIONS = [
|
||||
'intl',
|
||||
'json',
|
||||
'mbstring',
|
||||
'pdo',
|
||||
'xml',
|
||||
'xsl',
|
||||
'zip',
|
||||
];
|
||||
|
||||
/**
|
||||
* Directories which need to be writable by the webserver.
|
||||
*/
|
||||
@@ -118,7 +105,8 @@ final class DoctorController extends AbstractController
|
||||
*/
|
||||
private function getOpcacheConfiguration(): array
|
||||
{
|
||||
$status = \function_exists('opcache_get_status') ? opcache_get_status() : false;
|
||||
$known = \function_exists('opcache_get_status');
|
||||
$status = $known ? opcache_get_status() : false;
|
||||
|
||||
$enabled = \is_array($status) && $status['opcache_enabled'];
|
||||
|
||||
@@ -127,6 +115,7 @@ final class DoctorController extends AbstractController
|
||||
}
|
||||
|
||||
return [
|
||||
'unknown' => !$known,
|
||||
'enabled' => $enabled,
|
||||
'status' => $status,
|
||||
];
|
||||
@@ -168,9 +157,27 @@ final class DoctorController extends AbstractController
|
||||
*/
|
||||
private function getLoadedExtensions(): array
|
||||
{
|
||||
$json = file_get_contents(__DIR__ . '/../../composer.json');
|
||||
if ($json === false) {
|
||||
return ['Failed loading composer.json' => false];
|
||||
}
|
||||
|
||||
$composer = json_decode($json, true);
|
||||
if (!\is_array($composer)) {
|
||||
return ['Failed parsing composer.json' => false];
|
||||
}
|
||||
|
||||
if (!\array_key_exists('require', $composer)) {
|
||||
return ['Missing requirements in composer.json' => false];
|
||||
}
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach (self::REQUIRED_EXTENSIONS as $extName) {
|
||||
foreach ($composer['require'] as $name => $version) {
|
||||
if (!str_starts_with($name, 'ext-')) {
|
||||
continue;
|
||||
}
|
||||
$extName = str_replace('ext-', '', $name);
|
||||
$results[$extName] = false;
|
||||
if (\extension_loaded($extName)) {
|
||||
$results[$extName] = true;
|
||||
|
||||
Reference in New Issue
Block a user