[FOLLOWUP][FEATURE] Introduce Request/Response based on PSR-7 30/41130/2
authorBenjamin Mack <benni@typo3.org>
Mon, 13 Jul 2015 15:10:16 +0000 (17:10 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 13 Jul 2015 15:10:43 +0000 (17:10 +0200)
Make install tool work again.

Resolves: #67558
Releases: master
Change-Id: Ia6630c705cbcd34fda95f797071cca56b19954b9
Reviewed-on: http://review.typo3.org/41130
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/install/Classes/Http/RequestHandler.php

index 43c98e4..7521870 100644 (file)
@@ -289,8 +289,9 @@ class Bootstrap {
         *
         * @return Bootstrap
         * @throws \TYPO3\CMS\Core\Exception
+        * @internal This is not a public API method, do not use in own extensions
         */
-       protected function handleRequest() {
+       public function handleRequest() {
                // Build the Request object
                $request = \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals();
 
index 7bc2bee..6ccce1e 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Install\Http;
  * The TYPO3 project - inspiring people to share!
  */
 
+use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Core\RequestHandlerInterface;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -43,10 +44,11 @@ class RequestHandler implements RequestHandlerInterface {
         * Handles an install tool request
         * Execute 'tool' or 'step' controller depending on install[controller] GET/POST parameter
         *
+        * @param ServerRequestInterface $request
         * @return void
         */
-       public function handleRequest() {
-               $getPost = GeneralUtility::_GP('install');
+       public function handleRequest(ServerRequestInterface $request) {
+               $getPost = !empty($request->getQueryParams()['install']) ? $request->getQueryParams()['install'] : $request->getParsedBody()['install'];
                switch ($getPost['controller']) {
                        case 'tool':
                                $controllerClassName = \TYPO3\CMS\Install\Controller\ToolController::class;
@@ -65,9 +67,10 @@ class RequestHandler implements RequestHandlerInterface {
         * please note that both checks are needed, as when in "failsafe" mode, the TYPO3_REQUESTTYPE is not
         * necessarily set at this point.
         *
+        * @param ServerRequestInterface $request
         * @return bool Returns always TRUE
         */
-       public function canHandleRequest() {
+       public function canHandleRequest(ServerRequestInterface $request) {
                return TRUE;
        }