Commit 15ef75bc authored by Benni Mack's avatar Benni Mack Committed by Andreas Fernandez
Browse files

[FEATURE] Add Dispatcher for Backend Routing

The newly introduced Backend Routing is updated so that Routes
must define not just the controller but also the action which should
be called. It is now also possible to use a Closure / callable directly
to be called as a Route.

The RequestHandler now creates the Response object, which is
handed to the Dispatcher and to the respective action. This way
each action can already use the existing Response object.

The Dispatcher resolves the action and hands over the request and
response object.

All existing routes have been adapted to use controller and actions.

The fixed ControllerInterface is not needed anymore.

Resolves: #69855
Releases: master
Change-Id: I6edcf8e0f6b49580052f24ca9fd7ad352b6d6f34
Reviewed-on: http://review.typo3.org/43337


Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
parent ac07d82d
...@@ -14,12 +14,12 @@ namespace TYPO3\CMS\Backend\Controller; ...@@ -14,12 +14,12 @@ namespace TYPO3\CMS\Backend\Controller;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository; use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository;
use TYPO3\CMS\Backend\Module\ModuleLoader; use TYPO3\CMS\Backend\Module\ModuleLoader;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface; use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
...@@ -30,7 +30,7 @@ use TYPO3\CMS\Rsaauth\RsaEncryptionEncoder; ...@@ -30,7 +30,7 @@ use TYPO3\CMS\Rsaauth\RsaEncryptionEncoder;
/** /**
* Class for rendering the TYPO3 backend * Class for rendering the TYPO3 backend
*/ */
class BackendController implements \TYPO3\CMS\Core\Http\ControllerInterface { class BackendController {
/** /**
* @var string * @var string
...@@ -245,15 +245,13 @@ class BackendController implements \TYPO3\CMS\Core\Http\ControllerInterface { ...@@ -245,15 +245,13 @@ class BackendController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/** /**
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* As this controller goes only through the render() method, it is rather simple for now * As this controller goes only through the render() method, it is rather simple for now
* This will be split up in an abstract controller once proper routing/dispatcher is in place.
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return \Psr\Http\Message\ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->render(); $this->render();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content); $response->getBody()->write($this->content);
return $response; return $response;
} }
......
...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller; ...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Template\DocumentTemplate; use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
...@@ -31,7 +30,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; ...@@ -31,7 +30,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/** /**
* Script Class for grid wizard * Script Class for grid wizard
*/ */
class BackendLayoutWizardController implements \TYPO3\CMS\Core\Http\ControllerInterface { class BackendLayoutWizardController {
// GET vars: // GET vars:
// Wizard parameters, coming from TCEforms linking to the wizard. // Wizard parameters, coming from TCEforms linking to the wizard.
...@@ -211,13 +210,11 @@ class BackendLayoutWizardController implements \TYPO3\CMS\Core\Http\ControllerIn ...@@ -211,13 +210,11 @@ class BackendLayoutWizardController implements \TYPO3\CMS\Core\Http\ControllerIn
* As this controller goes only through the main() method, it is rather simple for now * As this controller goes only through the main() method, it is rather simple for now
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request
* @return ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->doc->render('Grid wizard', $this->content)); $response->getBody()->write($this->doc->render('Grid wizard', $this->content));
return $response; return $response;
} }
...@@ -271,7 +268,7 @@ class BackendLayoutWizardController implements \TYPO3\CMS\Core\Http\ControllerIn ...@@ -271,7 +268,7 @@ class BackendLayoutWizardController implements \TYPO3\CMS\Core\Http\ControllerIn
* Returns the sourcecode to the browser * Returns the sourcecode to the browser
* *
* @return void * @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/ */
public function printContent() { public function printContent() {
GeneralUtility::logDeprecatedFunction(); GeneralUtility::logDeprecatedFunction();
......
...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement; ...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
...@@ -25,7 +24,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; ...@@ -25,7 +24,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
* Script Class for showing the history module of TYPO3s backend * Script Class for showing the history module of TYPO3s backend
* @see \TYPO3\CMS\Backend\History\RecordHistory * @see \TYPO3\CMS\Backend\History\RecordHistory
*/ */
class ElementHistoryController implements \TYPO3\CMS\Core\Http\ControllerInterface { class ElementHistoryController {
/** /**
* @var string * @var string
...@@ -58,17 +57,16 @@ class ElementHistoryController implements \TYPO3\CMS\Core\Http\ControllerInterfa ...@@ -58,17 +57,16 @@ class ElementHistoryController implements \TYPO3\CMS\Core\Http\ControllerInterfa
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now * As this controller goes only through the main() method, it is rather simple for now
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
$this->content .= $this->doc->endPage(); $this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content); $this->content = $this->doc->insertStylesAndJS($this->content);
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content); $response->getBody()->write($this->content);
return $response; return $response;
} }
...@@ -109,7 +107,7 @@ class ElementHistoryController implements \TYPO3\CMS\Core\Http\ControllerInterfa ...@@ -109,7 +107,7 @@ class ElementHistoryController implements \TYPO3\CMS\Core\Http\ControllerInterfa
* Outputting the accumulated content to screen * Outputting the accumulated content to screen
* *
* @return void * @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/ */
public function printContent() { public function printContent() {
GeneralUtility::logDeprecatedFunction(); GeneralUtility::logDeprecatedFunction();
......
...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement; ...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
...@@ -30,7 +29,7 @@ use TYPO3\CMS\Backend\Backend\Avatar\Avatar; ...@@ -30,7 +29,7 @@ use TYPO3\CMS\Backend\Backend\Avatar\Avatar;
/** /**
* Script Class for showing information about an item. * Script Class for showing information about an item.
*/ */
class ElementInformationController implements \TYPO3\CMS\Core\Http\ControllerInterface { class ElementInformationController {
/** /**
* Record table name * Record table name
...@@ -194,18 +193,17 @@ class ElementInformationController implements \TYPO3\CMS\Core\Http\ControllerInt ...@@ -194,18 +193,17 @@ class ElementInformationController implements \TYPO3\CMS\Core\Http\ControllerInt
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now * As this controller goes only through the main() method, it is rather simple for now
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
$content = $this->doc->startPage($this->titleTag); $content = $this->doc->startPage($this->titleTag);
$content .= $this->doc->insertStylesAndJS($this->content); $content .= $this->doc->insertStylesAndJS($this->content);
$content .= $this->doc->endPage(); $content .= $this->doc->endPage();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($content); $response->getBody()->write($content);
return $response; return $response;
} }
...@@ -540,7 +538,7 @@ class ElementInformationController implements \TYPO3\CMS\Core\Http\ControllerInt ...@@ -540,7 +538,7 @@ class ElementInformationController implements \TYPO3\CMS\Core\Http\ControllerInt
* End page and print content * End page and print content
* *
* @return void * @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/ */
public function printContent() { public function printContent() {
GeneralUtility::logDeprecatedFunction(); GeneralUtility::logDeprecatedFunction();
......
...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement; ...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
...@@ -26,7 +25,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; ...@@ -26,7 +25,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
/** /**
* Script Class for rendering the move-element wizard display * Script Class for rendering the move-element wizard display
*/ */
class MoveElementController implements \TYPO3\CMS\Core\Http\ControllerInterface { class MoveElementController {
/** /**
* @var int * @var int
...@@ -128,14 +127,13 @@ class MoveElementController implements \TYPO3\CMS\Core\Http\ControllerInterface ...@@ -128,14 +127,13 @@ class MoveElementController implements \TYPO3\CMS\Core\Http\ControllerInterface
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now * As this controller goes only through the main() method, it is rather simple for now
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content); $response->getBody()->write($this->content);
return $response; return $response;
} }
...@@ -255,7 +253,7 @@ class MoveElementController implements \TYPO3\CMS\Core\Http\ControllerInterface ...@@ -255,7 +253,7 @@ class MoveElementController implements \TYPO3\CMS\Core\Http\ControllerInterface
* Print out the accumulated content: * Print out the accumulated content:
* *
* @return void * @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/ */
public function printContent() { public function printContent() {
GeneralUtility::logDeprecatedFunction(); GeneralUtility::logDeprecatedFunction();
......
...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement; ...@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
...@@ -27,7 +26,7 @@ use TYPO3\CMS\Core\Utility\PathUtility; ...@@ -27,7 +26,7 @@ use TYPO3\CMS\Core\Utility\PathUtility;
/** /**
* Script Class for the New Content element wizard * Script Class for the New Content element wizard
*/ */
class NewContentElementController implements \TYPO3\CMS\Core\Http\ControllerInterface { class NewContentElementController {
/** /**
* Page id * Page id
...@@ -165,14 +164,13 @@ class NewContentElementController implements \TYPO3\CMS\Core\Http\ControllerInte ...@@ -165,14 +164,13 @@ class NewContentElementController implements \TYPO3\CMS\Core\Http\ControllerInte
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now * As this controller goes only through the main() method, it is rather simple for now
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content); $response->getBody()->write($this->content);
return $response; return $response;
} }
...@@ -324,7 +322,7 @@ class NewContentElementController implements \TYPO3\CMS\Core\Http\ControllerInte ...@@ -324,7 +322,7 @@ class NewContentElementController implements \TYPO3\CMS\Core\Http\ControllerInte
* Print out the accumulated content: * Print out the accumulated content:
* *
* @return void * @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/ */
public function printContent() { public function printContent() {
GeneralUtility::logDeprecatedFunction(); GeneralUtility::logDeprecatedFunction();
......
...@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Backend\Controller; ...@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Backend\Controller;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
/** /**
* Script Class, creating the content for the dummy script - which is just blank output. * Script Class, creating the content for the dummy script - which is just blank output.
*/ */
class DummyController implements \TYPO3\CMS\Core\Http\ControllerInterface { class DummyController {
/** /**
* @var string * @var string
...@@ -40,14 +39,13 @@ class DummyController implements \TYPO3\CMS\Core\Http\ControllerInterface { ...@@ -40,14 +39,13 @@ class DummyController implements \TYPO3\CMS\Core\Http\ControllerInterface {
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now * As this controller goes only through the main() method, it is rather simple for now
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content); $response->getBody()->write($this->content);
return $response; return $response;
} }
...@@ -68,7 +66,7 @@ class DummyController implements \TYPO3\CMS\Core\Http\ControllerInterface { ...@@ -68,7 +66,7 @@ class DummyController implements \TYPO3\CMS\Core\Http\ControllerInterface {
* Outputting the accumulated content to screen * Outputting the accumulated content to screen
* *
* @return void * @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/ */
public function printContent() { public function printContent() {
GeneralUtility::logDeprecatedFunction(); GeneralUtility::logDeprecatedFunction();
......
...@@ -14,14 +14,13 @@ namespace TYPO3\CMS\Backend\Controller; ...@@ -14,14 +14,13 @@ namespace TYPO3\CMS\Backend\Controller;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Form\Exception\AccessDeniedException; use TYPO3\CMS\Backend\Form\Exception\AccessDeniedException;
use TYPO3\CMS\Backend\Form\FormResultCompiler; use TYPO3\CMS\Backend\Form\FormResultCompiler;
use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility; use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessage;
...@@ -41,7 +40,7 @@ use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord; ...@@ -41,7 +40,7 @@ use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord;
* Script Class: Drawing the editing form for editing records in TYPO3. * Script Class: Drawing the editing form for editing records in TYPO3.
* Notice: It does NOT use tce_db.php to submit data to, rather it handles submissions itself * Notice: It does NOT use tce_db.php to submit data to, rather it handles submissions itself
*/ */
class EditDocumentController implements \TYPO3\CMS\Core\Http\ControllerInterface { class EditDocumentController {
/** /**
* GPvar "edit": Is an array looking approx like [tablename][list-of-ids]=command, eg. * GPvar "edit": Is an array looking approx like [tablename][list-of-ids]=command, eg.
...@@ -1610,11 +1609,11 @@ class EditDocumentController implements \TYPO3\CMS\Core\Http\ControllerInterface ...@@ -1610,11 +1609,11 @@ class EditDocumentController implements \TYPO3\CMS\Core\Http\ControllerInterface
/** /**
* Injects the request object for the current request or subrequest * Injects the request object for the current request or subrequest
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request the current request
* @return \Psr\Http\Message\ResponseInterface $response * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
BackendUtility::lockRecords(); BackendUtility::lockRecords();
// Preprocessing, storing data if submitted to // Preprocessing, storing data if submitted to
...@@ -1628,8 +1627,6 @@ class EditDocumentController implements \TYPO3\CMS\Core\Http\ControllerInterface ...@@ -1628,8 +1627,6 @@ class EditDocumentController implements \TYPO3\CMS\Core\Http\ControllerInterface
$this->init(); $this->init();
$this->main(); $this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content); $response->getBody()->write($this->content);
return $response; return $response;
} }
......
...@@ -16,8 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\File; ...@@ -16,8 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\File;
use TYPO3\CMS\Backend\Template\DocumentTemplate; use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Http\ControllerInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException; use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
...@@ -31,7 +29,7 @@ use TYPO3\CMS\Core\Utility\MathUtility; ...@@ -31,7 +29,7 @@ use TYPO3\CMS\Core\Utility\MathUtility;
/** /**
* Script Class for the create-new script; Displays a form for creating up to 10 folders or one new text file * Script Class for the create-new script; Displays a form for creating up to 10 folders or one new text file
*/ */
class CreateFolderController implements ControllerInterface { class CreateFolderController {
/** /**
* @var int * @var int
...@@ -304,13 +302,13 @@ class CreateFolderController implements ControllerInterface { ...@@ -304,13 +302,13 @@ class CreateFolderController implements ControllerInterface {
/** /**
* Processes the request, currently everything is handled and put together via "main()" * Processes the request, currently everything is handled and put together via "main()"
* *
* @param ServerRequestInterface $request The request object * @param ServerRequestInterface $request the current request
* @return ResponseInterface $response The response, created by the controller * @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/ */
public function processRequest(ServerRequestInterface $request) { public function mainAction(ServerRequestInterface $request, ResponseInterface $response) {
$this->main(); $this->main();
/** @var Response $response */