diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php index 3c5b15fb7e..7753f1b25f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php @@ -65,6 +65,7 @@ EOT ['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) ? ' Expired' : '')], ['End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' Expired' : '')], new TableSeparator(), diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 33fdbad057..bfed460ab7 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -146,6 +146,9 @@ {{ symfony_status[collector.symfonystate]|upper }} + {% if collector.symfonylts %} +   Long-Term Support + {% endif %} {{ collector.symfonyeom }} {{ collector.symfonyeol }} diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php index c3c3f94ead..ddc331af62 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -83,6 +83,7 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte $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'); @@ -169,6 +170,14 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte 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. diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php index add100d47b..18269d28e7 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -36,6 +36,7 @@ class ConfigDataCollectorTest extends TestCase $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());