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
-------
1da79ed2ec
[HttpKernel] Add lts config
This commit is contained in:
commit
24af4c5c92
@ -65,6 +65,7 @@ EOT
|
||||
['<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(),
|
||||
|
@ -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 %}
|
||||
<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>
|
||||
|
@ -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.
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user