-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c65600
commit a1b0c01
Showing
2 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Acquia\Cli\Command\Self; | ||
|
||
use Acquia\Cli\Command\CommandBase; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Helper\Table; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
#[AsCommand(name: 'self:status')] | ||
|
||
final class SelfStatusCommand extends CommandBase | ||
{ | ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$table = new Table($output); | ||
$table->setStyle('borderless'); | ||
$table->setHeaders(['Property', 'Value']); | ||
$table->addRow(['Version', $this->getApplication()->getVersion()]); | ||
$table->addRow(['Cloud datastore', $this->datastoreCloud->filepath]); | ||
$table->addRow(['ACLI datastore', $this->datastoreAcli->filepath]); | ||
$table->addRow(['Telemetry enabled', var_export($this->telemetryHelper->telemetryEnabled(), true)]); | ||
$table->addRow(['User ID', $this->telemetryHelper->getUserId()]); | ||
foreach ($this->telemetryHelper->getTelemetryUserData() as $key => $value) { | ||
$table->addRow([$key, $value]); | ||
} | ||
$table->render(); | ||
return Command::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters