8000 Adds option to check EOL via about command by domgraziano · Pull Request #37861 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Adds option to check EOL via about command #37861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\HttpKernel\Kernel;
Expand All @@ -38,6 +39,7 @@ protected function configure()
{
$this
->setDescription('Displays information about the current project')
->addOption('is-maintained', null, InputOption::VALUE_NONE, 'Exits if current symfony Kernel is unmaintained (usable with CI tools)')
->setHelp(<<<'EOT'
The <info>%command.name%</info> command displays information about the current Symfony project.

Expand All @@ -46,9 +48,12 @@ protected function configure()

The <info>Environment</info> section displays the current environment variables managed by Symfony Dotenv. It will not
be shown if no variables were found. The values might be different between web and CLI.

Passing <info>is-maintained</info> as an option you will get an error if the current symfony kernel is End of Maintenance
(can be used in CI as check `php bin/console about --is-maintained`

EOT
)
;
);
}

/**
Expand All @@ -61,6 +66,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var KernelInterface $kernel */
$kernel = $this->getApplication()->getKernel();

if ($input->getOption('is-maintained') && self::isExpired(Kernel::END_OF_MAINTENANCE)) {
$io->error(sprintf(&# 50C3 39;Symfony "%s" is not maintained anymore, see https://symfony.com/releases to upgrade.', Kernel::VERSION));

return 1;
}

$rows = [
['<info>Symfony</>'],
new TableSeparator(),
Expand Down
0