Feature #83725

Epic #83894: PSR-15 Initiative

Introduce PSR-15 HTTP Middleware support

Added by Benjamin Franzke over 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2018-01-29
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The PSR-15 middleware specification was released on 22nd of january 2018.
TYPO3 should support PSR-15 middlewares out-of-the box.

Supporting PSR-15 middlewares improves interoperability with independent libraries and would superseed ugly hooks like $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] (ugly as they have not been adapted when PSR-7 Requests/Responses were introduced).


Related issues

Related to TYPO3 Core - Task #83724: HTTP RequestHandlers should always return a PSR-7 ResponseInterface, not NULL Closed 2018-01-29
Related to TYPO3 Core - Task #83727: Reimplement EXT:redirect as PSR-15 middleware Closed 2018-01-29
Related to TYPO3 Core - Feature #83907: Allow disabling a middleware Closed 2018-02-15

Associated revisions

Revision f22792ec (diff)
Added by Benni Mack over 1 year ago

[FEATURE] Add support for PSR-15 HTTP middlewares

PSR-15 middlewares are hooks on steroids for HTTP requests.
Due to chaining middlewares and the core request handler(s),
middlewares can execute code before and after the application.

Middlewares may return early, that means they can prevent
consecutive middleware and the core application from being executed
at all.

A full middleware coverage for all requests will need
a lot of changes to the core and extensions.
We'll eventually need to stop using header()/exit()/die()
or HttpUtility::{redirect,sendRespose}(). Those method calls
need to be replaced by manipulation of PSR-7 message objects.

Change-Id: I075639835115f7cf28f18c3814ef6dd190fdf29b
Releases: master
Resolves: #83725
Reviewed-on: https://review.typo3.org/55528
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 9266297f (diff)
Added by Benjamin Franzke over 1 year ago

[FEATURE] Add support for PSR-15 HTTP middlewares

PSR-15 middlewares are hooks on steroids for HTTP requests.
Due to chaining middlewares and the core request handler(s),
middlewares can execute code before and after the application.

Middlewares may return early, that means they can prevent
consecutive middleware and the core application from being executed
at all.

A full middleware coverage for all requests will need
a lot of changes to the core and extensions.
We'll eventually need to stop using header()/exit()/die()
or HttpUtility::{redirect,sendRespose}(). Those method calls
need to be replaced by manipulation of PSR-7 message objects.

PSR-15 interfaces are provided by psr/http-server-middleware:

composer require psr/http-server-middleware:^1.0

Change-Id: Ia906d51da2e4309a37fb47a7966b52f873782d8f
Releases: master
Resolves: #83725
Reviewed-on: https://review.typo3.org/55544
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 62399539 (diff)
Added by Christian Kuhn over 1 year ago

[FEATURE] Allow deactivation of PSR-15 middlewares

Similar to other places that use dependency configurations
via arrays, the middleware stack configuration now allows
disabling single middlewares by setting disabled=true.

Change-Id: I42c741062b5f6952577e164939593f0553b1ad31
Resolves: #83907
Related: #83906
Related: #83725
Releases: master
Reviewed-on: https://review.typo3.org/55725
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Benjamin Franzke <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Benjamin Franzke over 1 year ago

  • Related to Task #83724: HTTP RequestHandlers should always return a PSR-7 ResponseInterface, not NULL added

#2 Updated by Benjamin Franzke over 1 year ago

  • Related to Task #83727: Reimplement EXT:redirect as PSR-15 middleware added

#3 Updated by Benjamin Franzke over 1 year ago

  • Tracker changed from Task to Feature

#4 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#9 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#10 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#12 Updated by Gerrit Code Review over 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#13 Updated by Gerrit Code Review over 1 year ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#14 Updated by Gerrit Code Review over 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#15 Updated by Gerrit Code Review over 1 year ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#16 Updated by Gerrit Code Review over 1 year ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#17 Updated by Gerrit Code Review over 1 year ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55528

#18 Updated by Benni Mack over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#19 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55544

#20 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55544

#21 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55544

#22 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55544

#23 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55544

#24 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55544

#25 Updated by Benjamin Franzke over 1 year ago

  • Status changed from Under Review to Resolved

#26 Updated by Susanne Moog over 1 year ago

  • Parent task set to #83894

#27 Updated by Christian Kuhn over 1 year ago

#28 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF