You are here

private function ConfigDataCollector::determineSymfonyState in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php \Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::determineSymfonyState()

Tries to retrieve information about the current Symfony version.

Return value

string One of: dev, stable, eom, eol

1 call to ConfigDataCollector::determineSymfonyState()
ConfigDataCollector::collect in vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
Collects data for the given Request and Response.

File

vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php, line 273

Class

ConfigDataCollector
ConfigDataCollector.

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

private function determineSymfonyState() {
  $now = new \DateTime();
  $eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE)
    ->modify('last day of this month');
  $eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE)
    ->modify('last day of this month');
  if ($now > $eol) {
    $versionState = 'eol';
  }
  elseif ($now > $eom) {
    $versionState = 'eom';
  }
  elseif ('' !== Kernel::EXTRA_VERSION) {
    $versionState = 'dev';
  }
  else {
    $versionState = 'stable';
  }
  return $versionState;
}