Initiative Title: PSR-15 Middlewares for TYPO3

Summary

The main goal of the first part of the persistence initiative is cleaning up the existing data handling layers in TYPO3 and providing a unified persistence layer for use in all contexts and by extension developers and the core alike.

Background

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 hooks like $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'].

Additionally implementing PSR-7 for request and responses throughout the core enables us to group all request related settings in one place allowing to simulate context dependent requests in another context (for example frontend requests done on CLI or backend).

Goals

  • For greater interoperability all requests in TYPO3 return a PSR-7 response.
  • A frontend request can be initiated in the backend (for example render a content element completely as it would be rendered in the frontend in a backend module).
  • For greater interoperability and consistency the PSR-7 request object is used throughout the controllers in the TYPO3 core.
  • Global request parameters / server attributes are accessed through the request object instead of a superglobal.

Milestones

  • Introduce PSR-15 middlewares (done)
  • Refactor backend bootstrap/request handler code to middlewares (partly done)
  • Refactor frontend bootstrap/request handler code to middlewares (partly done)
  • Deprecate GeneralUtility::getIndpEnv vars and replace with request
  • Deprecate GeneralUtility::_GET / _POST / _GP and replace with request
  • Add request to TSFE via feature flag (and use it in TSFE)
  • Add request context object to frontend request
  • Extract connectToDb, __construct, initFeUser, initBeUser, AdminPanelInit from TSFE to middlewares
    • FrontendInitializor (done)
    • FrontendUserInitializor
    • BackendUserInitializor
    • AdminPanelInitializor (done)
  • ...
     
Image about timing (calendar)

Timing

Target for the first part of this initiative is v9 LTS, the main goals should be reached (including deprecation of old code and removal of access to said code from the TYPO3 Core) is targeted for v10.

Scope

Scope of this initiative are mainly the areas “Request Handling”, “Bootstrap” and “Middlewares”.

Current Status

Epic-Link: https://forge.typo3.org/issues/83894 (note that only the tickets currently in progress or done are listed here)

Get involved!

Team

Benni Mack (Lead)

Benjamin Franzke

Christian Kuhn

You?