Skip to content

Commit 9a6fd2d

Browse files
committed
feature #57829 [FrameworkBundle] Finetune AboutCommand (JoppeDC)
This PR was squashed before being merged into the 7.2 branch. Discussion ---------- [FrameworkBundle] Finetune `AboutCommand` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT - Make the AboutCommand show more details about the XDebug extension (Installed vs Enabled). - Show the same info about the OPcache and APCu extensions Commits ------- 3440aeee4a [FrameworkBundle] Finetune `AboutCommand`
2 parents 43607ee + 062c0a7 commit 9a6fd2d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Command/AboutCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* A console command to display information about the current installation.
2626
*
2727
* @author Roland Franssen <[email protected]>
28+
* @author Joppe De Cuyper <[email protected]>
2829
*
2930
* @final
3031
*/
@@ -57,6 +58,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5758
$buildDir = $kernel->getCacheDir();
5859
}
5960

61+
$xdebugMode = getenv('XDEBUG_MODE') ?: \ini_get('xdebug.mode');
62+
6063
$rows = [
6164
['<info>Symfony</>'],
6265
new TableSeparator(),
@@ -81,9 +84,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8184
['Architecture', (\PHP_INT_SIZE * 8).' bits'],
8285
['Intl locale', class_exists(\Locale::class, false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'],
8386
['Timezone', date_default_timezone_get().' (<comment>'.(new \DateTimeImmutable())->format(\DateTimeInterface::W3C).'</>)'],
84-
['OPcache', \extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) ? 'true' : 'false'],
85-
['APCu', \extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOL) ? 'true' : 'false'],
86-
['Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'],
87+
['OPcache', \extension_loaded('Zend OPcache') ? (filter_var(\ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'Enabled' : 'Not enabled') : 'Not installed'],
88+
['APCu', \extension_loaded('apcu') ? (filter_var(\ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'Enabled' : 'Not enabled') : 'Not installed'],
89+
['Xdebug', \extension_loaded('xdebug') ? ($xdebugMode && $xdebugMode !== 'off' ? 'Enabled (' . $xdebugMode . ')' : 'Not enabled') : 'Not installed'],
8790
];
8891

8992
$io->table([], $rows);

0 commit comments

Comments
 (0)