-
Notifications
You must be signed in to change notification settings - Fork 50
Only require Twig when profiler is enabled #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I cannot test this (yet) because of #301 |
As written in #300 I do not think we should forbid using the profiler tools when Twig is not installed. Using them in tests does not require Twig if I do not miss anything. |
@xabbuh It's not only the Twig extension that requires Twig, right? Also by registering the profiler button in the web profiler it requires Twig? Shouldn't we remove these services when Twig is not installed? <service id="httplug.collector.collector" class="Http\HttplugBundle\Collector\Collector" public="false">
<tag name="data_collector" template="@Httplug/webprofiler.html.twig" priority="200" id="httplug"/>
</service>
<service id="httplug.plugin.stack" class="Http\HttplugBundle\Collector\StackPlugin" public="false" abstract="true">
<argument type="service" id="httplug.collector.collector"/>
<argument type="service" id="httplug.collector.formatter"/>
</service> |
I changed the PR. It now removes the Twig extension when Twig is not installed. I think it's impossible to use the Symfony Web Toolbar without Twig, right? |
The |
@xabbuh Thanks for the explanation. I get it know. So this PR should be good then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, this change makes sense to me. i think we should only remove the service if we loaded it. not sure if symfony would complain when trying to remove a definition that does not exist - but even if not, i want to avoid confusion
can you please include the change to composer.json in this PR as well, moving and can you please add a changelog entry? please use "1.15.0 [unreleased]" as heading. |
@dbu I applied the suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, looks good to me!
What's in this PR?
Require Twig to be installed when the profiler is enabled. Move
twig/twig
dependency to suggest andrequire-dev
Why?
We don't have Twig installed in our project. HTTPlug requires it to be installed.
Checklist