Skip to content

Commit 7487ccb

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: bumped min version of Twig to 1.28
2 parents f2a7704 + ef40651 commit 7487ccb

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=5.3.9",
2020
"doctrine/common": "~2.4",
21-
"twig/twig": "~1.27|~2.0",
21+
"twig/twig": "~1.28|~2.0",
2222
"psr/log": "~1.0",
2323
"symfony/security-acl": "~2.7|~3.0.0",
2424
"symfony/polyfill-apcu": "~1.1",

src/Symfony/Bundle/SecurityBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
3838
"symfony/expression-language": "~2.6|~3.0.0",
3939
"doctrine/doctrine-bundle": "~1.2",
40-
"twig/twig": "~1.27|~2.0"
40+
"twig/twig": "~1.28|~2.0"
4141
},
4242
"autoload": {
4343
"psr-4": { "Symfony\\Bundle\\SecurityBundle\\": "" },

src/Symfony/Bundle/TwigBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/twig-bridge": "~2.7|~3.0.0",
2222
"symfony/http-foundation": "~2.5|~3.0.0",
2323
"symfony/http-kernel": "~2.7",
24-
"twig/twig": "~1.27|~2.0"
24+
"twig/twig": "~1.28|~2.0"
2525
},
2626
"require-dev": {
2727
"symfony/stopwatch": "~2.2|~3.0.0",

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function panelAction(Request $request, $token)
110110
'panel' => $panel,
111111
'page' => $page,
112112
'request' => $request,
113-
'templates' => $this->getTemplateManager()->getTemplates($profile),
113+
'templates' => $this->getTemplateManager()->getNames($profile),
114114
'is_ajax' => $request->isXmlHttpRequest(),
115115
'profiler_markup_version' => 2, // 1 = original profiler, 2 = Symfony 2.8+ profiler
116116
)), 200, array('Content-Type' => 'text/html'));
@@ -210,7 +210,7 @@ public function toolbarAction(Request $request, $token)
210210
'request' => $request,
211211
'position' => $position,
212212
'profile' => $profile,
213-
'templates' => $this->getTemplateManager()->getTemplates($profile),
213+
'templates' => $this->getTemplateManager()->getNames($profile),
214214
'profiler_url' => $url,
215215
'token' => $token,
216216
'profiler_markup_version' => 2, // 1 = original toolbar, 2 = Symfony 2.8+ toolbar

src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function getName(Profile $profile, $panel)
6767
*
6868
* @param Profile $profile
6969
*
70-
* @return array
70+
* @return Twig_Template[]
71+
*
72+
* @deprecated not used anymore internally
7173
*/
7274
public function getTemplates(Profile $profile)
7375
{
@@ -89,7 +91,7 @@ public function getTemplates(Profile $profile)
8991
*
9092
* @throws \UnexpectedValueException
9193
*/
92-
protected function getNames(Profile $profile)
94+
public function getNames(Profile $profile)
9395
{
9496
$templates = array();
9597

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@
7171
{% if templates is defined %}
7272
<ul id="menu-profiler">
7373
{% for name, template in templates %}
74-
{% set menu %}{{ template.renderBlock('menu', { collector: profile.getcollector(name), profiler_markup_version: profiler_markup_version }) }}{% endset %}
74+
{% set menu -%}
75+
{% with { collector: profile.getcollector(name), profiler_markup_version: profiler_markup_version } %}
76+
{{ block('menu', template) }}
77+
{% endwith %}
78+
{%- endset %}
7579
{% if menu is not empty %}
7680
<li class="{{ name }} {{ name == panel ? 'selected' : '' }}">
7781
<a href="{{ path('_profiler', { token: token, panel: name }) }}">{{ menu|raw }}</a>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig

+9-8
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626

2727
<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset clear-fix" data-no-turbolink>
2828
{% for name, template in templates %}
29-
{{ template.renderblock('toolbar', {
30-
'collector': profile.getcollector(name),
31-
'profiler_url': profiler_url,
32-
'token': profile.token,
33-
'name': name,
34-
'profiler_markup_version': profiler_markup_version
35-
})
36-
}}
29+
{% with {
30+
collector: profile.getcollector(name),
31+
profiler_url: profiler_url,
32+
token: profile.token,
33+
name: name,
34+
profiler_markup_version: profiler_markup_version
35+
} %}
36+
{{ block('toolbar', template) }}
37+
{% endwith %}
3738
{% endfor %}
3839

3940
{% if 'normal' != position %}

0 commit comments

Comments
 (0)