From 53870df3c2a5e380ced05d1ecc59cd003f85aa91 Mon Sep 17 00:00:00 2001 From: "Abdulmhsen B. A. A" Date: Sat, 16 Mar 2024 20:39:50 +0300 Subject: [PATCH] include backend version in basic report. --- src/Commands/System/ReportCommand.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Commands/System/ReportCommand.php b/src/Commands/System/ReportCommand.php index 9af11002..a571ca4a 100644 --- a/src/Commands/System/ReportCommand.php +++ b/src/Commands/System/ReportCommand.php @@ -149,16 +149,22 @@ final class ReportCommand extends Command $includeSample = (bool)$input->getOption('include-db-sample'); foreach (Config::get('servers', []) as $name => $backend) { + try { + $version = $this->getBackend($name, $backend)->getVersion(); + } catch (Throwable) { + $version = 'Unknown'; + } + foreach (Index::BLACK_LIST as $hideValue) { if (true === ag_exists($backend, $hideValue)) { $backend = ag_set($backend, $hideValue, '**HIDDEN**'); } } - $output->writeln( - r('[ {type} ==> {name} ]' . PHP_EOL, [ + r('[ {type} ({version}) ==> {name} ]' . PHP_EOL, [ 'name' => $name, 'type' => ucfirst(ag($backend, 'type')), + 'version' => $version, ]) ); @@ -270,9 +276,9 @@ final class ReportCommand extends Command ) : '{}', ]) ); - - $output->writeln(''); } + + $output->writeln(''); } }