[FEATURE] Introduce Request/Response based on PSR-7
The PSR-7 standard is adapted into the TYPO3 Bootstrap with a backwards-compatible layer. The PSR-7 implementation brings several new classes: * Message (the base for Requests and Responses) * Request (for Requests made within PHP) * ServerRequest and a factory based on the current system environment * Response * Uri (a unified API for fetching several parts of an URI) At any TYPO3 request a new ServerRequest object is created inside the Bootstrap and handed over to the RequestHandler which can then use this object for checking certain GET and POST variables instead of using GeneralUtility. The proper call (usually a Controller) creates a Response object that is handed back to the RequestHandler + Bootstrap. The TYPO3 Bootstrap will output anything related in the shutdown() method. An example is shown with the LoginController and currently hard-wired as no proper routing/dispatching is there yet. Currently this is an internal API as the rest (Dispatch/Router and Controller API) will follow once the base is in. Please note that the PSR-7 standard works with Value Objects meaning that it is not possible to modify any object but instead new objects will be created for Message, ServerRequest and Response if modified. The next steps are: * Integrate proper Routing + Dispatching for Backend Routes to register new BE requests * Migrate all AJAX Calls to use the new API and request / response handling * Introduce a common Base Controller for all regular BE requests which is based on Request/Response and works as a replacement for sc_base * Then: proper documentation for the whole bootstrap / dispatch + routing / controller logic * Integrate symfony console app into the CLI Bootstrap as alternative for Request/Response * Refactor TSFE to use Response / Request objects properly * Refactor redirects logic to use Response objects Resolves: #67558 Releases: master Change-Id: I5b528284ecca790f784c7780b008356158343ee8 Reviewed-on: http://review.typo3.org/40355 Reviewed-by:Helmut Hummel <helmut.hummel@typo3.org> Tested-by:
Helmut Hummel <helmut.hummel@typo3.org> Reviewed-by:
Wouter Wolters <typo3@wouterwolters.nl> Tested-by:
Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by:
Markus Klein <markus.klein@typo3.org> Tested-by:
Markus Klein <markus.klein@typo3.org> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- composer.json 2 additions, 1 deletioncomposer.json
- typo3/index.php 1 addition, 5 deletionstypo3/index.php
- typo3/sysext/backend/Classes/Console/CliRequestHandler.php 5 additions, 2 deletionstypo3/sysext/backend/Classes/Console/CliRequestHandler.php
- typo3/sysext/backend/Classes/Controller/LoginController.php 19 additions, 3 deletionstypo3/sysext/backend/Classes/Controller/LoginController.php
- typo3/sysext/backend/Classes/Http/AjaxRequestHandler.php 13 additions, 9 deletionstypo3/sysext/backend/Classes/Http/AjaxRequestHandler.php
- typo3/sysext/backend/Classes/Http/BackendModuleRequestHandler.php 19 additions, 6 deletions...sext/backend/Classes/Http/BackendModuleRequestHandler.php
- typo3/sysext/backend/Classes/Http/RequestHandler.php 31 additions, 4 deletionstypo3/sysext/backend/Classes/Http/RequestHandler.php
- typo3/sysext/backend/Tests/Unit/Http/BackendModuleRequestHandlerTest.php 15 additions, 10 deletions...ckend/Tests/Unit/Http/BackendModuleRequestHandlerTest.php
- typo3/sysext/core/Classes/Core/Bootstrap.php 48 additions, 16 deletionstypo3/sysext/core/Classes/Core/Bootstrap.php
- typo3/sysext/core/Classes/Core/RequestHandlerInterface.php 8 additions, 5 deletionstypo3/sysext/core/Classes/Core/RequestHandlerInterface.php
- typo3/sysext/core/Classes/Http/ControllerInterface.php 37 additions, 0 deletionstypo3/sysext/core/Classes/Http/ControllerInterface.php
- typo3/sysext/core/Classes/Http/Message.php 472 additions, 0 deletionstypo3/sysext/core/Classes/Http/Message.php
- typo3/sysext/core/Classes/Http/Request.php 349 additions, 0 deletionstypo3/sysext/core/Classes/Http/Request.php
- typo3/sysext/core/Classes/Http/Response.php 201 additions, 0 deletionstypo3/sysext/core/Classes/Http/Response.php
- typo3/sysext/core/Classes/Http/ServerRequest.php 369 additions, 0 deletionstypo3/sysext/core/Classes/Http/ServerRequest.php
- typo3/sysext/core/Classes/Http/ServerRequestFactory.php 152 additions, 0 deletionstypo3/sysext/core/Classes/Http/ServerRequestFactory.php
- typo3/sysext/core/Classes/Http/Stream.php 343 additions, 0 deletionstypo3/sysext/core/Classes/Http/Stream.php
- typo3/sysext/core/Classes/Http/UploadedFile.php 265 additions, 0 deletionstypo3/sysext/core/Classes/Http/UploadedFile.php
- typo3/sysext/core/Classes/Http/Uri.php 716 additions, 0 deletionstypo3/sysext/core/Classes/Http/Uri.php
- typo3/sysext/core/Tests/Unit/Http/MessageTest.php 302 additions, 0 deletionstypo3/sysext/core/Tests/Unit/Http/MessageTest.php
Please register or sign in to comment