8000 feature #31539 [HttpKernel] Add lts config (noniagriconomie) · symfony/symfony@24af4c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24af4c5

Browse files
committed
feature #31539 [HttpKernel] Add lts config (noniagriconomie)
This PR was squashed before being merged into the 4.4-dev branch (closes #31539). Discussion ---------- [HttpKernel] Add lts config | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | . | License | MIT | Doc PR | is it needed? Hi, I was playing with data collector in a demo project, so I propose this for symfony <img width="872" alt="symfony_lts" src="https://user-images.githubusercontent.com/13205768/57979986-1ec33900-7a25-11e9-8199-13ed45b4fa78.png"> <img width="748" alt="symfony_lts_cli" src="https://user-images.githubusercontent.com/13205768/57980004-75c90e00-7a25-11e9-8e95-edefb2b7e9d1.png"> Commits ------- 1da79ed [HttpKernel] Add lts config
2 parents 63d7309 + 1da79ed commit 24af4c5

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-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', 4 === Kernel::MINOR_VERSION ? '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: 9 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'] = 4 === Kernel::MINOR_VERSION;
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,14 @@ 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+
public function isSymfonyLts(): bool
177+
{
178+
return $this->data['symfony_lts'];
179+
}
180+
172181
/**
173182
* Returns the human redable date when this Symfony version ends its
174183
* maintenance period.

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(4 === Kernel::MINOR_VERSION, $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)
0