-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added a note about how to enable http_method_override for caching kernels #5008
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
Changes from 3 commits
b52d4af
e7ac0c6
bcd0d68
5b71fda
4600e75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,23 @@ kernel:: | |
The caching kernel will immediately act as a reverse proxy - caching responses | ||
from your application and returning them to the client. | ||
|
||
..caution:: | ||
|
||
By default, the caching kernel ignores the ``framework.http_method_override`` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. caching kernel -> cached kernel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about this: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about: "By default, a kernel based the cache ignores the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is some sort of typo in your last suggestion:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "a kernel based on the cache ingores [...]" |
||
option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE`` | ||
methods in HTTP requests. | ||
|
||
Invoke the ``enableHttpMethodParameterOverride()`` method before creating the | ||
``Request`` object in order to take this option into account:: | ||
|
||
// web/app.php | ||
// ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should be an empty line between a file comment and any other comment |
||
$kernel = new AppCache($kernel); | ||
|
||
Request::enableHttpMethodParameterOverride(); // <-- add this line | ||
$request = Request::createFromGlobals(); | ||
// ... | ||
|
||
.. tip:: | ||
|
||
The cache kernel has a special ``getLog()`` method that returns a string | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,9 +77,12 @@ http_method_override | |
This determines whether the ``_method`` request parameter is used as the intended | ||
HTTP method on POST requests. If enabled, the | ||
:method:`Request::enableHttpMethodParameterOverride <Symfony\\Component\\HttpFoundation\\Request::enableHttpMethodParameterOverride>` | ||
method gets called automatically. It becomes the service container parameter | ||
named ``kernel.http_method_override``. For more information, see | ||
:doc:`/cookbook/routing/method_parameters`. | ||
method gets called automatically, unless the application uses a caching kernel, | ||
where you need to invoke that method manually (see :ref:`symfony2-reverse-proxy` | ||
for details). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to make my life easier, what do you think about removing this from this PR and putting it into my config reference rewrite PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed this change ... but please don't forget to add it into your PR. Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done: b560fab |
||
|
||
It becomes the service container parameter named ``kernel.http_method_override``. | ||
For more information, see :doc:`/cookbook/routing/method_parameters`. | ||
|
||
ide | ||
~~~ | ||
|
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.
missing space between
..
andcaution