35 lines
909 B
PHP
35 lines
909 B
PHP
<?php
|
|
namespace Incoviba\Command;
|
|
|
|
use Symfony\Component\Console;
|
|
use Incoviba\Common\Alias;
|
|
|
|
#[Console\Attribute\AsCommand(
|
|
name: 'external:services',
|
|
description: 'Check external services',
|
|
)]
|
|
class ExternalServices extends Alias\Command
|
|
{
|
|
protected function configure(): void
|
|
{
|
|
$this->addOption('update', 'u', Console\Input\InputOption::VALUE_NONE, 'Update');
|
|
}
|
|
|
|
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
|
|
{
|
|
$update = $input->getOption('update');
|
|
|
|
$url = '/api/external/services/check';
|
|
|
|
if ($update) {
|
|
$url = '/api/external/services/update';
|
|
}
|
|
|
|
$output->writeln("GET {$url}");
|
|
$response = $this->client->get($url);
|
|
$output->writeln("Response Code: {$response->getStatusCode()}");
|
|
|
|
return Console\Command\Command::SUCCESS;
|
|
}
|
|
}
|