8000 [HttpKernel] Add lts config by noniagriconomie · Pull Request #31539 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Add lts config #31539

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

Merged
merged 1 commit into from
May 25, 2019
Merged
Show file tree
Hide file tree
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
[HttpKernel] Add lts config
  • Loading branch information
noniagriconomie authored and fabpot committed May 25, 2019
commit 1da79ed2ec3eb2864e81e63993fbecad8d87ab47
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
['<info>Symfony</>'],
new TableSeparator(),
['Version', Kernel::VERSION],
['Long-Term Support', 4 === Kernel::MINOR_VERSION ? 'Yes' : 'No'],
['End of maintenance', Kernel::END_OF_MAINTENANCE.(self::isExpired(Kernel::END_OF_MAINTENANCE) ? ' <error>Expired</>' : '')],
['End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' <error>Expired</>' : '')],
new TableSeparator(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
<tr>
<td class="font-normal">
<span class="label status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
{% if collector.symfonylts %}
&nbsp; <span class="label status-success">Long-Term Support</span>
{% endif %}
</td>
<td class="font-normal">{{ collector.symfonyeom }}</td>
<td class="font-normal">{{ collector.symfonyeol }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function collect(Request $request, Response $response, \Exception $except

$this->data['symfony_state'] = $this->determineSymfonyState();
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
$this->data['symfony_lts'] = 4 === Kernel::MINOR_VERSION;
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
$this->data['symfony_eom'] = $eom->format('F Y');
Expand Down Expand Up @@ -169,6 +170,14 @@ public function getSymfonyMinorVersion()
return $this->data['symfony_minor_version'];
}

/**
* Returns if the current Symfony version is a Long-Term Support one.
*/
public function isSymfonyLts(): bool
{
return $this->data['symfony_lts'];
}

/**
* Returns the human redable date when this Symfony version ends its
* maintenance period.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function testCollect()
$this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
$this->assertSame(4 === Kernel::MINOR_VERSION, $c->isSymfonyLts());
$this->assertNull($c->getToken());
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache());
Expand Down
0