Allow to change the environment, kernel.debug and HttpCache by cookie #679
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would like to propose the possibility to use cookies to change the Kernel environment, debug mode and enabling the
HttpCache
.This is helpful if you want to
dev
environment, but fail withproduction
settingskernel.debug
disabled or with theHttpCache
This solution is convenient because it can easily be used from a browser. Cookies will persist for subsequent requests and will not otherwise "pollute" the URL. JavaScript/Bookmarklets can be used to easily set, change or revert settings. Also, the cookies can easily be added in tools like
curl
,ab
or a Behat/Mink session.The alternative of editing
.env
files and/or theindex.php
file is not easily available in automated test setups. Also, you cannot have two browser instances/windows in parallel that work with different settings at the same time.Of course, this should only be possible under very special conditions, namely your development environment. So, a
SYMFONY_ALLOW_OVERRIDE
environment variable must have been set in the webserver to allow it.