Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2eebe8

Browse files
committed
feature #15523 Redesigned the Symfony Profiler (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15523). Discussion ---------- Redesigned the Symfony Profiler | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ### Context Recently, we redesigned the web debug toolbar ([read announcement](http://symfony.com/blog/new-in-symfony-2-8-redesigned-web-debug-toolbar)). We maintained "the spirit" of the original toolbar, but its visual appearance was completely changed. Now it's the turn of the Symfony Profiler. We want to update it to match the new toolbar design and to give it a more modern look and feel. ### The redesign Most of the redesign is focused on updating just the visual appearance, but we've seized this opportunity to make some minor functional changes as well. Testing this pull request in your own applications may be difficult, so we'll provide below a complete walkthrough of the redesign. (Click on the images to see them in full resolution) ### Overview This is the new general structure of the profiler pages: ![profiler-structure](https://cloud.githubusercontent.com/assets/73419/9226162/c1bf71f0-410d-11e5-8a7b-5c690b7c8c8a.png) ### Request panel * Renamed `Request` panel to `Request / Response` * Divided contents into tabs: Request, Response, Session, etc. (this prevents ultra long pages) ![profiler-request](https://cloud.githubusercontent.com/assets/73419/9226172/cb7f7938-410d-11e5-8ffd-cea8264446dd.png) ### Timeline panel * Renamed `Timeline` panel to `Performance` * Highlighted the most important metrics * Added "Peak Memory Usage" to those metrics * The timeline graph is now easier to read (font size is slightly larger, updated the color palette, made the canvas wider, etc.) * If there is only one request, the page doesn't distract you with the "Master Request" heading. If there are several sub-requests, headings are now bigger and graphs are more separated. ![profiler-performance](https://cloud.githubusercontent.com/assets/73419/9226178/d1335782-410d-11e5-9f9a-5ace45b0dfa0.png) ### Twig panel * Just a minor update to highlight the important metrics. The rest of the contents remain the same. ![profiler-twig](https://cloud.githubusercontent.com/assets/73419/9226180/d5bd6ff4-410d-11e5-86c8-beba426516c1.png) ### Exception panel * Just minor design tweaks. ![profiler-exception](https://cloud.githubusercontent.com/assets/73419/9226182/da0dfd9e-410d-11e5-965c-e980f7144541.png) ### Events panel When the `framework.ide` config option is set: * The listeners are now displayed as more evident clickable links. * Bellow the listener we show its full class namespace (if you don't need this information, it doesn't distract you much; if you need it, you don't have to wait for the `<abbr>` tooltip to show it) ![profiler-events-links-enabled](https://cloud.githubusercontent.com/assets/73419/9226188/e403ae48-410d-11e5-8c86-5d28fed940e7.png) When the `framework.ide` config option is NOT set: * In this case the developer cannot click on the listener name to go to that file and line. Therefore, we think it's important to display that information (full class namespace + full file path + line number). At first it may seem that it contains too much information ... but this panel should be more "useful" than "beautiful". ![profiler-events-links-disabled](https://cloud.githubusercontent.com/assets/73419/9226198/eb9f3bae-410d-11e5-8bbe-95c148809387.png) ### Logs panel * Logs are now grouped in: "Info. & Errors" (this is the panel that you need most of the times); "Deprecations" (separated from the normal logs because they are specific to the process of updating your Symfony version); and "Debug" (which are all those messages that you almost never need) * We now show the channel for the log messages (for built-in Symfony channels it may be redundant, but your application can define custom channels) ![profiler-logger](https://cloud.githubusercontent.com/assets/73419/9226203/f345163a-410d-11e5-85e6-cf9fceb885fc.png) ### Routing panel * Just a minor redesign and highlighted some information. ![profiler-routing](https://cloud.githubusercontent.com/assets/73419/9226213/00e99130-410e-11e5-90c0-dda9394dabd7.png) ### Forms panel * Not redesigned yet. ### Translation panel * Highlighted the important metrics. * Replaced the old selector by the new tabbed navigation. ![profiler-translation](https://cloud.githubusercontent.com/assets/73419/9226215/06036c40-410e-11e5-90c9-fe3b43dd6156.png) ### Security panel * Just a minor redesign and highlighted some information. ![profiler-security](https://cloud.githubusercontent.com/assets/73419/9226217/0a92fbcc-410e-11e5-9438-e9e230a7865b.png) ### E-mails panel * Not redesigned yet. ### Doctrine panel * Queries are no longer displayed "shrinked". We display the full query without parameters by default. * The three old actions ("expand", "runnable" and "explain") have been reduced to two actions ("runnable" and "explain") ![profiler-doctrine](https://cloud.githubusercontent.com/assets/73419/9226225/13e0b5d4-410e-11e5-96ce-1eb67f99df49.png) Here you can see what happens when you click on the "Show runnable query" and "Explain query" links: ![profiler-doctrine-detail](https://cloud.githubusercontent.com/assets/73419/9226247/33b47918-410e-11e5-9657-e1351787657a.png) ### Debug panel * Not redesigned yet. ### Config panel * This was probably the "ugliest" panel in the old profiler, because of the two first tables. * We now display the information of those tables highlighted in a different way. ![profiler-config](https://cloud.githubusercontent.com/assets/73419/9226257/3d728850-410e-11e5-86d8-da807f6a1217.png) ### Search results Results with response status different from 2xx now are highlighted: ![profiler-search-results](https://cloud.githubusercontent.com/assets/73419/9226279/44bacd8e-410e-11e5-8daf-e77d2be7e3c6.png) ### Other design elements The page title now changes for each section: **Before** ![page-title-before](https://cloud.githubusercontent.com/assets/73419/9226312/6301b9c4-410e-11e5-8ef7-001be222ac53.png) **After** ![page-title-after](https://cloud.githubusercontent.com/assets/73419/9226316/693bce42-410e-11e5-897a-c5e4413bc638.png) Empty elements now display a dashed border. This allows to make design more consistent between different section. Besides, once you are used to the new design, your brain will immediately associate that design to an empty element, so you'll no longer need to read the inner text content. ![profiler-empty-element](https://cloud.githubusercontent.com/assets/73419/9226400/c9ffe06a-410e-11e5-9859-f095e444d9af.png) Besides, when the entire panel doesn't have any content, its menu label looks disabled: ![sidebar-menu](https://cloud.githubusercontent.com/assets/73419/9226405/cf4ee5e8-410e-11e5-9501-523cd6b3413e.png) Long pages have been break down using a tabs-based navigation: ![tabbed-navigation](https://cloud.githubusercontent.com/assets/73419/9226409/d918dba6-410e-11e5-9cd4-516a082950de.gif) Below the page header we display a "summary section" which displays the profiled URL and some useful profiling information. The big URL is the natural way to "go back to application" from the profiler: ![summary-back-to-application](https://cloud.githubusercontent.com/assets/73419/9226414/df1abb00-410e-11e5-88ff-59dbd35b584f.gif) Besides, the summary background color changes according to the response HTTP status code: ![profiler-summary](https://cloud.githubusercontent.com/assets/73419/9226423/e5b03850-410e-11e5-9163-2f2153c5d1de.png) Above the main menu we now display two shortcuts to common operations: "display the 10 most recent profiles" and "search profiles": ![sidebar-shortcuts](https://cloud.githubusercontent.com/assets/73419/9226427/eaea4586-410e-11e5-8ff4-f6141723996a.png) The search form in the sidebar has been collapsed and it's revealed when clicking on the "Search" shortcut button: ![search-form-reveal](https://cloud.githubusercontent.com/assets/73419/9226435/ef907fec-410e-11e5-9627-37cb2a241f86.gif) ----- And that's all! Please tell us what you think about this redesign. **Don't hesitate to criticize anything you don't like or think it's wrong or it's worse than in the previous profiler.** Let's work together to make the new profiler a reality! Thanks! Commits ------- 05773c2 Redesigned the Symfony Profiler
2 parents fbba5d9 + 05773c2 commit a2eebe8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2547
-1767
lines changed

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,20 @@ public function getMacroCount()
7474
public function getHtmlCallGraph()
7575
{
7676
$dumper = new \Twig_Profiler_Dumper_Html();
77-
78-
return new \Twig_Markup($dumper->dump($this->getProfile()), 'UTF-8');
77+
$dump = $dumper->dump($this->getProfile());
78+
79+
// needed to remove the hardcoded CSS styles
80+
$dump = str_replace(array(
81+
'<span style="background-color: #ffd">',
82+
'<span style="color: #d44">',
83+
'<span style="background-color: #dfd">',
84+
), array(
85+
'<span class="status-warning">',
86+
'<span class="status-error">',
87+
'<span class="status-success">',
88+
), $dump);
89+
90+
return new \Twig_Markup($dump, 'UTF-8');
7991
}
8092

8193
public function getProfile()
Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
22

33
{% block toolbar %}
4-
{% set dumps_count = collector.dumpsCount %}
5-
6-
{% if dumps_count %}
4+
{% if collector.dumpsCount %}
75
{% set icon %}
8-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
9-
<path fill="#AAAAAA" d="M12,22.6c-5.8,0-10.5-4.7-10.5-10.5C1.5,6.3,6.2,1.5,12,1.5s10.5,4.7,10.5,10.5C22.5,17.9,17.8,22.6,12,22.6z M12,4.5c-4.2,0-7.5,3.4-7.5,7.5c0,4.2,3.4,7.5,7.5,7.5s7.5-3.4,7.5-7.5C19.5,7.9,16.2,4.5,12,4.5z"/>
10-
<path fill="#AAAAAA" d="M12,9.1c-0.8,0-1.5-0.7-1.5-1.5v-6c0-0.8,0.7-1.5,1.5-1.5s1.5,0.7,1.5,1.5v6C13.5,8.4,12.8,9.1,12,9.1zM13.5,22.4v-6c0-0.8-0.7-1.5-1.5-1.5s-1.5,0.7-1.5,1.5v6c0,0.8,0.7,1.5,1.5,1.5S13.5,23.2,13.5,22.4z M23.9,12c0-0.8-0.7-1.5-1.5-1.5h-6c-0.8,0-1.5,0.7-1.5,1.5s0.7,1.5,1.5,1.5h6C23.2,13.5,23.9,12.8,23.9,12z M9.1,12c0-0.8-0.7-1.5-1.5-1.5h-6c-0.8,0-1.5,0.7-1.5,1.5s0.7,1.5,1.5,1.5h6C8.4,13.5,9.1,12.8,9.1,12z"/>
11-
</svg>
12-
<span class="sf-toolbar-value">{{ dumps_count }}</span>
6+
{{ include('@Debug/Profiler/icon.svg') }}
7+
<span class="sf-toolbar-value">{{ collector.dumpsCount }}</span>
138
{% endset %}
149

1510
{% set text %}
@@ -28,6 +23,7 @@
2823
{% endif %}
2924
</span>
3025
<span class="sf-toolbar-file-line">line {{ dump.line }}</span>
26+
3127
{{ dump.data|raw }}
3228
</div>
3329
{% endfor %}
@@ -39,42 +35,18 @@
3935
{% endblock %}
4036

4137
{% block menu %}
42-
<span class="label">
43-
<span class="icon">
44-
{{- "" -}}
45-
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 28 28" enable-background="new 0 0 28 28" xml:space="preserve"><path fill="#3F3F3F" d="M28 13h-1.1C26.5 6.6 21.4 1.5 15 1.1V0h-2v1.1C6.6 1.5 1.5 6.6 1.1 13H0v2h1.1C1.5 21.4 6.6 26.5 13 26.9 V28h2v-1.1c6.4-0.5 11.5-5.6 11.9-11.9H28V13z M15 24.9V19h-2v5.9c-5.3-0.5-9.5-4.7-9.9-9.9H9v-2H3.1C3.5 7.7 7.7 3.5 13 3.1V9h2 V3.1c5.3 0.5 9.5 4.7 9.9 9.9H19v2h5.9C24.5 20.3 20.3 24.5 15 24.9z"/></svg>
46-
{{- "" -}}
47-
</span>
48-
<strong>dump()</strong>
49-
<span class="count">
50-
<span>{{ collector.dumpsCount }}</span>
51-
</span>
38+
<span class="label {{ collector.dumpsCount == 0 ? 'disabled' }}">
39+
<span class="icon">{{ include('@Debug/Profiler/icon.svg') }}</span>
40+
<strong>Debug</strong>
5241
</span>
5342
{% endblock %}
5443

5544
{% block panel %}
56-
<h2>dump()</h2>
45+
<h2>Dumped Contents</h2>
5746

58-
<style>
59-
li.sf-dump {
60-
list-style-type: disc;
61-
}
62-
.sf-dump ol>li {
63-
padding: 0;
64-
}
65-
.sf-dump a {
66-
cursor: pointer;
67-
}
68-
.sf-dump-compact {
69-
display: none;
70-
}
71-
</style>
72-
73-
{% if collector.dumpsCount %}
74-
<ul class="alt">
75-
{% for dump in collector.getDumps('html') %}
76-
<li class="sf-dump sf-reset">
77-
in
47+
{% for dump in collector.getDumps('html') %}
48+
<div class="sf-dump sf-reset">
49+
<h3>In
7850
{% if dump.line %}
7951
{% set link = dump.file|file_link(dump.line) %}
8052
{% if link %}
@@ -85,19 +57,22 @@
8557
{% else %}
8658
{{ dump.name }}
8759
{% endif %}
88-
line {{ dump.line }}:
89-
<a onclick="var s = this.nextElementSibling; if ('sf-dump-compact' == s.className) {this.innerHTML = '&#9660;'; s.className = 'sf-dump-expanded';} else {this.innerHTML = '&#9654;'; s.className = 'sf-dump-compact';}">&#9654;</a>
90-
<span class="sf-dump-compact">
91-
{% if dump.fileExcerpt %}{{ dump.fileExcerpt|raw }}{% else %}{{ dump.file|file_excerpt(dump.line) }}{% endif %}
92-
</span>
60+
<small>line {{ dump.line }}</small>
9361

94-
{{ dump.data|raw }}
95-
</li>
96-
{% endfor %}
97-
</ul>
62+
<a class="text-small sf-toggle" data-toggle-selector="#sf-trace-{{ loop.index0 }}" data-toggle-alt-content="Hide code">Show code</a>
63+
</h3>
64+
65+
<div class="sf-dump-compact hidden" id="sf-trace-{{ loop.index0 }}">
66+
<div class="trace">
67+
{{ dump.fileExcerpt ? dump.fileExcerpt|raw : dump.file|file_excerpt(dump.line) }}
68+
</div>
69+
</div>
70+
71+
{{ dump.data|raw }}
72+
</div>
9873
{% else %}
99-
<p>
100-
<em>No dumped variable</em>
101-
</p>
102-
{% endif %}
74+
<div class="empty">
75+
<p>No content was dumped.</p>
76+
</div>
77+
{% endfor %}
10378
{% endblock %}
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 61 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
22

3+
{% block page_title 'Security' %}
4+
35
{% block toolbar %}
46
{% if collector.tokenClass %}
57
{% set is_authenticated = collector.enabled and collector.authenticated %}
@@ -9,9 +11,7 @@
911
{% endif %}
1012

1113
{% set icon %}
12-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
13-
<path fill="#AAAAAA" d="M21,20.4V22H3v-1.6c0-3.7,2.4-6.9,5.8-8c-1.7-1.1-2.9-3-2.9-5.2c0-3.4,2.7-6.1,6.1-6.1s6.1,2.7,6.1,6.1c0,2.2-1.2,4.1-2.9,5.2C18.6,13.5,21,16.7,21,20.4z"/>
14-
</svg>
14+
{{ include('@Security/Collector/icon.svg') }}
1515
<span class="sf-toolbar-value">{{ collector.user|default('n/a') }}</span>
1616
{% endset %}
1717

@@ -21,10 +21,12 @@
2121
<b>Logged in as</b>
2222
<span>{{ collector.user }}</span>
2323
</div>
24+
2425
<div class="sf-toolbar-info-piece">
2526
<b>Authenticated</b>
2627
<span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'red' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span>
2728
</div>
29+
2830
{% if collector.tokenClass != null %}
2931
<div class="sf-toolbar-info-piece">
3032
<b>Token class</b>
@@ -46,54 +48,69 @@
4648
{% endblock %}
4749

4850
{% block menu %}
49-
<span class="label">
50-
<span class="icon"><svg width="42" height="30" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 42 30" enable-background="new 0 0 42 30" xml:space="preserve"><g><path fill="#3F3F3F" d="M16.1 15.3c0-0.5 0-0.8 0-1.2c0.2-0.1 0.6-0.8 0.7-1.4c0.2 0 0.4-0.2 0.5-0.8c0-0.4-0.1-0.5-0.2-0.6 c0.3-0.8 0.8-3.4-1.1-3.7C15.7 7.2 15.2 7 14.6 7c-2.6 0-2.9 2-2.4 4.2c-0.1 0.1-0.3 0.3-0.2 0.6c0.1 0.7 0.3 0.8 0.5 0.8 c0.1 0.6 0.5 1.3 0.7 1.4c0 0.4 0 0.8 0 1.2c-0.5 1.4-4 1-4.2 3.7h11.2C20.1 16.3 16.6 16.7 16.1 15.3z"/><path fill="#3F3F3F" d="M28.3 10.2c-0.2 0-0.5 0.1-0.7 0.2c-0.2 0.1-0.4 0.3-0.6 0.6c-0.2 0.3-0.4 0.6-0.5 1s-0.2 0.7-0.2 1.1 c0 0.5 0.1 0.9 0.4 1.2s0.5 0.4 0.8 0.4c0.2 0 0.4-0.1 0.7-0.2c0.2-0.1 0.5-0.3 0.7-0.6s0.4-0.6 0.5-1c0.1-0.4 0.2-0.8 0.2-1.2 c0-0.5-0.1-0.9-0.4-1.2C29 10.3 28.7 10.2 28.3 10.2z"/><path fill="#3F3F3F" d="M34 4H7C6.4 4 6 4.4 6 5v19c0 0.6 0.4 1 1 1h5v-1c-0.6 0-1-0.4-1-1c0-0.6 0.4-1 1-1h2c0.6 0 1 0.4 1 1 c0 0.6-0.4 1-1 1v1h13v-1c-0.6 0-1-0.4-1-1c0-0.6 0.4-1 1-1h2c0.6 0 1 0.4 1 1c0 0.6-0.4 1-1 1v1h5c0.6 0 1-0.4 1-1V5 C35 4.4 34.6 4 34 4z M21 19c0 0.6-0.4 1-1 1H9c-0.6 0-1-0.4-1-1V7c0-0.6 0.4-1 1-1h11c0.6 0 1 0.4 1 1V19z M32.9 16.6 c-0.5 0.4-1 0.7-1.7 1c-0.6 0.2-1.4 0.4-2.3 0.4c-0.8 0-1.6-0.1-2.3-0.3c-0.7-0.2-1.3-0.5-1.8-1c-0.5-0.4-0.9-0.9-1.1-1.5 c-0.3-0.7-0.5-1.5-0.5-2.3c0-0.9 0.2-1.8 0.6-2.6c0.5-1 1.1-1.8 2-2.4C26.5 7.3 27.6 7 28.8 7c0.9 0 1.8 0.2 2.5 0.6 c0.7 0.4 1.3 1 1.8 1.7c0.4 0.7 0.6 1.4 0.6 2.1c0 1.1-0.4 2.1-1.2 2.9c-0.7 0.8-1.4 1.2-2.3 1.2c-0.3 0-0.5 0-0.6-0.1 c-0.2-0.1-0.3-0.2-0.4-0.3c0-0.1-0.1-0.3-0.1-0.5c-0.2 0.3-0.5 0.5-0.8 0.7c-0.3 0.2-0.6 0.3-0.9 0.3c-0.3 0-0.7-0.1-1-0.3 c-0.3-0.2-0.6-0.5-0.8-0.9c-0.2-0.4-0.3-0.9-0.3-1.3c0-0.6 0.2-1.2 0.5-1.8c0.3-0.6 0.7-1.1 1.2-1.4c0.5-0.3 0.9-0.5 1.3-0.5 c0.3 0 0.6 0.1 0.9 0.3c0.3 0.2 0.6 0.4 0.8 0.8l0.2-0.9h1l-0.8 3.8c-0.1 0.5-0.2 0.8-0.2 0.9c0 0.1 0 0.2 0.1 0.3 c0.1 0.1 0.2 0.1 0.3 0.1c0.2 0 0.5-0.1 0.8-0.3c0.4-0.3 0.8-0.7 1-1.2c0.3-0.5 0.4-1 0.4-1.6c0-0.6-0.2-1.2-0.5-1.8 c-0.3-0.6-0.8-1-1.5-1.3s-1.4-0.5-2.1-0.5c-0.9 0-1.7 0.2-2.4 0.6c-0.7 0.4-1.3 1-1.7 1.8C24.2 11 24 11.9 24 12.7 c0 0.9 0.2 1.7 0.6 2.4c0.4 0.7 1 1.2 1.8 1.5c0.8 0.3 1.6 0.5 2.5 0.5c1 0 1.8-0.2 2.5-0.5c0.7-0.3 1.2-0.7 1.5-1.2h1 C33.7 15.8 33.4 16.2 32.9 16.6z"/></g></svg></span>
51-
<strong>Security</strong>
52-
</span>
51+
<span class="label {{ not collector.enabled or not collector.tokenClass ? 'disabled' }}">
52+
<span class="icon">{{ include('@Security/Collector/icon.svg') }}</span>
53+
<strong>Security</strong>
54+
</span>
5355
{% endblock %}
5456

5557
{% block panel %}
56-
<h2>Security</h2>
58+
<h2>Security Token</h2>
59+
5760
{% if collector.tokenClass %}
61+
<div class="metrics">
62+
<div class="metric">
63+
<span class="value">{{ collector.user == 'anon.' ? 'Anonymous' : collector.user }}</span>
64+
<span class="label">Username</span>
65+
</div>
66+
67+
<div class="metric">
68+
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.authenticated ? 'yes' : 'no') ~ '.svg') }}</span>
69+
<span class="label">Authenticated</span>
70+
</div>
71+
</div>
72+
5873
<table>
59-
<tr>
60-
<th>Username</th>
61-
<td>{{ collector.user }}</td>
62-
</tr>
63-
<tr>
64-
<th>Authenticated?</th>
65-
<td>
66-
{% if collector.authenticated %}
67-
yes
68-
{% else %}
69-
no {% if not collector.roles|length %}<em>(probably because the user has no roles)</em>{% endif %}
70-
{% endif %}
71-
</td>
72-
</tr>
73-
<tr>
74-
<th>Roles</th>
75-
<td>{{ collector.roles|yaml_encode }}</td>
76-
</tr>
77-
{% if collector.supportsRoleHierarchy %}
78-
<tr>
79-
<th>Inherited Roles</th>
80-
<td>{{ collector.inheritedRoles|yaml_encode }}</td>
81-
</tr>
82-
{% endif %}
83-
{% if collector.tokenClass != null %}
84-
<tr>
85-
<th>Token class</th>
86-
<td>{{ collector.tokenClass }}</td>
87-
</tr>
88-
{% endif %}
74+
<thead>
75+
<tr>
76+
<th scope="col" class="key">Property</th>
77+
<th scope="col">Value</th>
78+
</tr>
79+
</thead>
80+
<tbody>
81+
<tr>
82+
<th>Roles</th>
83+
<td>
84+
{{ collector.roles is empty ? 'none' : collector.roles|yaml_encode }}
85+
86+
{% if not collector.authenticated and collector.roles is empty %}
87+
<p class="help">User is not authenticated probably because they have no roles.</p>
88+
{% endif %}
89+
</td>
90+
</tr>
91+
92+
{% if collector.supportsRoleHierarchy %}
93+
<tr>
94+
<th>Inherited Roles</th>
95+
<td>{{ collector.inheritedRoles is empty ? 'none' : collector.inheritedRoles|yaml_encode }}</td>
96+
</tr>
97+
{% endif %}
98+
99+
{% if collector.tokenClass %}
100+
<tr>
101+
<th>Token class</th>
102+
<td>{{ collector.tokenClass }}</td>
103+
</tr>
104+
{% endif %}
105+
</tbody>
89106
</table>
90107
{% elseif collector.enabled %}
91-
<p>
92-
<em>No token</em>
93-
</p>
108+
<div class="empty">
109+
<p>There is no security token.</p>
110+
</div>
94111
{% else %}
95-
<p>
96-
<em>The security component is disabled</em>
97-
</p>
112+
<div class="empty">
113+
<p>The security component is disabled.</p>
114+
</div>
98115
{% endif %}
99116
{% endblock %}

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public function panelAction(Request $request, $token)
112112
'request' => $request,
113113
'templates' => $this->getTemplateManager()->getTemplates($profile),
114114
'is_ajax' => $request->isXmlHttpRequest(),
115+
'profiler_markup_version' => 2, // 1 = original profiler, 2 = Symfony 2.8+ profiler
115116
)), 200, array('Content-Type' => 'text/html'));
116117
}
117118

0 commit comments

Comments
 (0)