File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Documentation/ApiOverview/RequestLifeCycle Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,18 @@ TYPO3 has implemented the PSR-15 approach in the following way:
6666
6767#. This response is passed back to the execution flow.
6868
69+ .. versionchanged :: 14.0
70+
71+ Middlewares must not rely on the PHP superglobals `$_GET ` / `$_POST `
72+ (and legacy `$HTTP_GET_VARS ` / :php: `$HTTP_POST_VARS `) being synchronized
73+ with the PSR-7 request. TYPO3 no longer resets these globals from request data.
74+
75+ Also note that :php: `$GLOBALS['TYPO3_REQUEST'] ` is a compatibility layer and
76+ may not be available in all middleware positions (it is set later in the
77+ application flow). Always use the PSR-7 request
78+ (:php: `\P sr\H ttp\M essage\S erverRequestInterface `) passed into
79+ `process() ` and pass it explicitly to services that need it.
80+
6981.. index :: Request handling; Middleware
7082.. _request-handling-middlewares :
7183
Original file line number Diff line number Diff line change @@ -171,6 +171,16 @@ If a request is needed initialize one as described in
171171Last resort: global variable
172172----------------------------
173173
174+ .. versionchanged :: 14.0
175+
176+ The global request variable is a compatibility layer and is no longer
177+ guaranteed to be available in all execution contexts. In particular,
178+ it may not be set yet in early PSR-15 middlewares.
179+
180+ Always prefer the PSR-7 request object passed explicitly to the current
181+ execution context.
182+
183+
174184TYPO3 provides the request object also in the global variable
175185:php: `$GLOBALS['TYPO3_REQUEST'] `. Whenever it is possible the request should be
176186retrieved within the contexts described above. But this is not always possible
You can’t perform that action at this time.
0 commit comments