Navigation Menu

Skip to content

Commit

Permalink
feature #20722 Updated the "Symfony Config" panel in the profiler (ja…
Browse files Browse the repository at this point in the history
…viereguiluz)

This PR was squashed before being merged into the 3.3-dev branch (closes #20722).

Discussion
----------

Updated the "Symfony Config" panel in the profiler

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This adds more information about the status of your Symfony version:

![symfony_config](https://cloud.githubusercontent.com/assets/73419/20830798/8ad42a1c-b882-11e6-9c5f-fac392d3118f.png)

And here some screenshots of the different statuses:

![symfony-dev](https://cloud.githubusercontent.com/assets/73419/20830807/9757aa2a-b882-11e6-8049-c156d9b16c83.png)

![symfony-eom](https://cloud.githubusercontent.com/assets/73419/20830810/9973b330-b882-11e6-8d57-6da3baafc256.png)

![symfony-eol](https://cloud.githubusercontent.com/assets/73419/20830811/9b99c67c-b882-11e6-8ff4-c76c77266e0c.png)

Commits
-------

0e454f3 Updated the "Symfony Config" panel in the profiler
  • Loading branch information
fabpot committed Dec 2, 2016
2 parents e765849 + 0e454f3 commit 6a0ee38
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
Expand Up @@ -181,6 +181,31 @@
</div>
{% endif %}
</div>

{% set symfony_status = { dev: 'Unstable Version', stable: 'Stable Version', eom: 'Maintenance Ended', eol: 'Version Expired' } %}
{% set symfony_status_class = { dev: 'warning', stable: 'success', eom: 'warning', eol: 'error' } %}
<table>
<thead class="small">
<tr>
<th>Symfony Status</th>
<th>Bugs {{ collector.symfonystate in ['eom', 'eol'] ? 'were' : 'are' }} fixed until</th>
<th>Security issues {{ collector.symfonystate == 'eol' ? 'were' : 'are' }} fixed until</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td class="font-normal">
<span class="label status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
</td>
<td class="font-normal">{{ collector.symfonyeom }}</td>
<td class="font-normal">{{ collector.symfonyeol }}</td>
<td class="font-normal">
<a href="https://symfony.com/roadmap?version={{ collector.symfonyminorversion }}#checker">View roadmap</a>
</td>
</tr>
</tbody>
</table>
{% endif %}

<h2>PHP Configuration</h2>
Expand Down
Expand Up @@ -166,6 +166,10 @@ table thead th {
table thead th.key {
width: 19%;
}
table thead.small th {
font-size: 12px;
padding: 4px 10px;
}

table tbody th,
table tbody td {
Expand Down
Expand Up @@ -83,6 +83,11 @@ public function collect(Request $request, Response $response, \Exception $except
}

$this->data['symfony_state'] = $this->determineSymfonyState();
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, 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');
$this->data['symfony_eol'] = $eol->format('F Y');
}
}

Expand Down Expand Up @@ -126,6 +131,39 @@ public function getSymfonyState()
return $this->data['symfony_state'];
}

/**
* Returns the minor Symfony version used (without patch numbers of extra
* suffix like "RC", "beta", etc.).
*
* @return string
*/
public function getSymfonyMinorVersion()
{
return $this->data['symfony_minor_version'];
}

/**
* Returns the human redable date when this Symfony version ends its
* maintenance period.
*
* @return string
*/
public function getSymfonyEom()
{
return $this->data['symfony_eom'];
}

/**
* Returns the human redable date when this Symfony version reaches its
* "end of life" and won't receive bugs or security fixes.
*
* @return string
*/
public function getSymfonyEol()
{
return $this->data['symfony_eol'];
}

/**
* Gets the PHP version.
*
Expand Down

0 comments on commit 6a0ee38

Please sign in to comment.