8000 Add a warning in WDT if using symfony/symfony · symfony/symfony@f7d4494 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7d4494

Browse files
committed
Add a warning in WDT if using symfony/symfony
1 parent 8523047 commit f7d4494

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\WebProfilerBundle\Controller;
1313

14+
use Symfony\Bundle\FullStack;
1415
use Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler;
1516
use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager;
1617
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -152,6 +153,7 @@ public function toolbarAction(Request $request, string $token = null): Response
152153
}
153154

154155
return $this->renderWithCspNonces($request, '@WebProfiler/Profiler/toolbar.html.twig', [
156+
'full_stack' => class_exists(FullStack::class),
155157
'request' => $request,
156158
'profile' => $profile,
157159
'templates' => $this->getTemplateManager()->getNames($profile),

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,11 @@ div.sf-toolbar .sf-toolbar-block a:hover {
545545
margin-right: 10px;
546546
}
547547

548+
.sf-full-stack {
549+
left: 0px;
550+
font-size: 12px;
551+
}
552+
548553
/***** Media query print: Do not print the Toolbar. *****/
549554
@media print {
550555
.sf-toolbar {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@
2222
{% endwith %}
2323
{% endif %}
2424
{% endfor %}
25+
{% if full_stack %}
26+
<div class="sf-full-stack sf-toolbar-block sf-toolbar-block-full-stack sf-toolbar-status-red sf-toolbar-block-right">
27+
<div class="sf-toolbar-icon">
28+
<span class="sf-toolbar-value">Using symfony/symfony is NOT supported</span>
29+
</div>
30+
<div class="sf-toolbar-info sf-toolbar-status-red">
31+
<p>This project is using Symfony via the "symfony/symfony" package.</p>
32+
<p>This is NOT supported anymore since Symfony 4.0.</p>
33+
<p>Even if it seems to work well, it has some important limitations with no workarounds.</p>
34+
<p>Using this package also makes your project slower.</p>
35+
36+
<strong>Please, stop using this package and replace it with individual packages instead.</strong>
37+
</div>
38+
<div></div>
39+
</div>
40+
{% endif %}
2541

2642
<button class="hide-button" type="button" id="sfToolbarHideButton-{{ token }}" title="Close Toolbar" accesskey="D" aria-expanded="true" aria-controls="sfToolbarMainContent-{{ token }}">
2743
{{ include('@WebProfiler/Icon/close.svg') }}

0 commit comments

Comments
 (0)
0