Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit07cb14b

Browse files
committed
[#5008] Shortening section and moving much of the note to reference
1 parent3c76623 commit07cb14b

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

‎book/http_cache.rst

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,9 @@ from your application and returning them to the client.
168168

169169
..caution::
170170

171-
By default, a kernel based on the cache ignores the ``framework.http_method_override``
172-
option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE``
173-
methods in HTTP requests.
174-
175-
Invoke the ``enableHttpMethodParameterOverride()`` method before creating the
176-
``Request`` object in order to take this option into account::
177-
178-
// web/app.php
179-
180-
// ...
181-
$kernel = new AppCache($kernel);
182-
183-
Request::enableHttpMethodParameterOverride(); // <-- add this line
184-
$request = Request::createFromGlobals();
185-
// ...
171+
If you're using the:ref:`framework.http_method_override<configuration-framework-http_method_override>`
172+
option to read the HTTP method from a ``_method`` parameter, see the
173+
above link for a tweak you need to make.
186174

187175
..tip::
188176

‎reference/configuration/framework.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ method gets called automatically. It becomes the service container parameter
8282
named ``kernel.http_method_override``. For more information, see
8383
:doc:`/cookbook/routing/method_parameters`.
8484

85+
..caution::
86+
87+
If you're using the:ref:`AppCache Reverse Proxy<symfony2-reverse-proxy>`
88+
with this option, the kernel will ignore the ``_method`` parameter,
89+
which could lead to errors.
90+
91+
To fix this, invoke the ``enableHttpMethodParameterOverride()`` method
92+
before creating the ``Request`` object::
93+
94+
// web/app.php
95+
96+
// ...
97+
$kernel = new AppCache($kernel);
98+
99+
Request::enableHttpMethodParameterOverride(); // <-- add this line
100+
$request = Request::createFromGlobals();
101+
// ...
102+
85103
ide
86104
~~~
87105

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp