[HttpKernel] Add lts config
This commit is contained in:
parent
5bf7759f3d
commit
1da79ed2ec
@ -65,6 +65,7 @@ EOT
|
|||||||
['<info>Symfony</>'],
|
['<info>Symfony</>'],
|
||||||
new TableSeparator(),
|
new TableSeparator(),
|
||||||
['Version', Kernel::VERSION],
|
['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 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</>' : '')],
|
['End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' <error>Expired</>' : '')],
|
||||||
new TableSeparator(),
|
new TableSeparator(),
|
||||||
|
@ -146,6 +146,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="font-normal">
|
<td class="font-normal">
|
||||||
<span class="label status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
|
<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>
|
||||||
<td class="font-normal">{{ collector.symfonyeom }}</td>
|
<td class="font-normal">{{ collector.symfonyeom }}</td>
|
||||||
<td class="font-normal">{{ collector.symfonyeol }}</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_state'] = $this->determineSymfonyState();
|
||||||
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
|
$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);
|
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
|
||||||
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
|
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
|
||||||
$this->data['symfony_eom'] = $eom->format('F Y');
|
$this->data['symfony_eom'] = $eom->format('F Y');
|
||||||
@ -169,6 +170,14 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
|||||||
return $this->data['symfony_minor_version'];
|
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
|
* Returns the human redable date when this Symfony version ends its
|
||||||
* maintenance period.
|
* 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(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
|
||||||
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
|
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
|
||||||
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
|
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
|
||||||
|
$this->assertSame(4 === Kernel::MINOR_VERSION, $c->isSymfonyLts());
|
||||||
$this->assertNull($c->getToken());
|
$this->assertNull($c->getToken());
|
||||||
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
|
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
|
||||||
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache());
|
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache());
|
||||||
|
Reference in New Issue
Block a user