Skip to content

Commit 3bc0bfe

Browse files
[HttpKernel] Add lts config
1 parent 5bf7759 commit 3bc0bfe

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6565
['<info>Symfony</>'],
6666
new TableSeparator(),
6767
['Version', Kernel::VERSION],
68+
['Long-Term Support', Kernel::LONG_TERM_SUPPORT ? 'Yes' : 'No'],
6869
['End of maintenance', Kernel::END_OF_MAINTENANCE.(self::isExpired(Kernel::END_OF_MAINTENANCE) ? ' <error>Expired</>' : '')],
6970
['End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' <error>Expired</>' : '')],
7071
new TableSeparator(),

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146
<tr>
147147
<td class="font-normal">
148148
<span class="label status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
149+
{% if collector.symfonylts %}
150+
&nbsp; <span class="label status-success">Long-Term Support</span>
151+
{% endif %}
149152
</td>
150153
<td class="font-normal">{{ collector.symfonyeom }}</td>
151154
<td class="font-normal">{{ collector.symfonyeol }}</td>

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function collect(Request $request, Response $response, \Exception $except
8383

8484
$this->data['symfony_state'] = $this->determineSymfonyState();
8585
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
86+
$this->data['symfony_lts'] = Kernel::LONG_TERM_SUPPORT;
8687
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
8788
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
8889
$this->data['symfony_eom'] = $eom->format('F Y');
@@ -169,6 +170,16 @@ public function getSymfonyMinorVersion()
169170
return $this->data['symfony_minor_version'];
170171
}
171172

173+
/**
174+
* Returns if the current Symfony version is a Long-Term Support one.
175+
*
176+
* @return bool
177+
*/
178+
public function isSymfonyLts()
179+
{
180+
return $this->data['symfony_lts'];
181+
}
182+
172183
/**
173184
* Returns the human redable date when this Symfony version ends its
174185
* maintenance period.

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
8282

8383
const END_OF_MAINTENANCE = '11/2022';
8484
const END_OF_LIFE = '11/2023';
85+
const LONG_TERM_SUPPORT = true;
8586

8687
public function __construct(string $environment, bool $debug)
8788
{

src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function testCollect()
3636
$this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
3737
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
3838
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
39+
$this->assertSame(Kernel::LONG_TERM_SUPPORT, $c->isSymfonyLts());
3940
$this->assertNull($c->getToken());
4041
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
4142
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache());

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy