10000 feature #20722 Updated the "Symfony Config" panel in the profiler (ja… · symfony/symfony@6a0ee38 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a0ee38

Browse files
committed
feature #20722 Updated the "Symfony Config" panel in the profiler (javiereguiluz)
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
2 parents e765849 + 0e454f3 commit 6a0ee38

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,31 @@
181181
</div>
182182
{% endif %}
183183
</div>
184+
185+
{% set symfony_status = { dev: 'Unstable Version', stable: 'Stable Version', eom: 'Maintenance Ended', eol: 'Version Expired' } %}
186+
{% set symfony_status_class = { dev: 'warning', stable: 'success', eom: 'warning', eol: 'error' } %}
187+
<table>
188+
<thead class="small">
189+
<tr>
190+
<th>Symfony Status</th>
191+
<th>Bugs {{ collector.symfonystate in ['eom', 'eol'] ? 'were' : 'are' }} fixed until</th>
192+
<th>Security issues {{ collector.symfonystate == 'eol' ? 'were' : 'are' }} fixed until</th>
193+
<th></th>
194+
</tr>
195+
</thead>
196+
<tbody>
197+
<tr>
198+
<td class="font-normal">
199+
<span class="label status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
200+
</td>
201+
<td class="font-normal">{{ collector.symfonyeom }}</td>
202+
<td class="font-normal">{{ collector.symfonyeol }}</td>
203+
<td class="font-normal">
204+
<a href="https://symfony.com/roadmap?version={{ collector.symfonyminorversion }}#checker">View roadmap</a>
205+
</td>
206+
</tr>
207+
</tbody>
208+
</table>
184209
{% endif %}
185210

186211
<h2>PHP Configuration</h2>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ table thead th {
166166
table thead th.key {
167167
width: 19%;
168168
}
169+
table thead.small th {
170+
font-size: 12px;
171+
padding: 4px 10px;
172+
}
169173

170174
table tbody th,
171175
table tbody td {

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public function collect(Request $request, Response $response, \Exception $except
8383
}
8484

8585
$this->data['symfony_state'] = $this->determineSymfonyState();
86+
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
87+
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
88+
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
89+
$this->data['symfony_eom'] = $eom->format('F Y');
90+
$this->data['symfony_eol'] = $eol->format('F Y');
8691
}
8792
}
8893

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

134+
/**
135+
* Returns the minor Symfony version used (without patch numbers of extra
136+
* suffix like "RC", "beta", etc.).
137+
*
138+
* @return string
139+
*/
140+
public function getSymfonyMinorVersion()
141+
{
142+
return $this->data['symfony_minor_version'];
143+
}
144+
145+
/**
146+
* Returns the human redable date when this Symfony version ends its
147+
* maintenance period.
148+
*
149+
* @return string
150+
*/
151+
public function getSymfonyEom()
152+
{
153+
return $this->data['symfony_eom'];
154+
}
155+
156+
/**
157+
* Returns the human redable date when this Symfony version reaches its
158+
* "end of life" and won't receive bugs or security fixes.
159+
*
160+
* @return string
161+
*/
162+
public function getSymfonyEol()
163+
{
164+
return $this->data['symfony_eol'];
165+
}
166+
129167
/**
130168
* Gets the PHP version.
131169
*

0 commit comments

Comments
 (0)
0