[TASK] Enable mssql on PHP 7.3 nightly tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / Web / BackendRequestHandler.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Mvc\Web;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Core\Environment;
18
19 /**
20 * A request handler which can handle web requests invoked by the backend.
21 * @internal only to be used within Extbase, not part of TYPO3 Core API.
22 */
23 class BackendRequestHandler extends AbstractRequestHandler
24 {
25 /**
26 * Handles the web request. The response will automatically be sent to the client.
27 *
28 * @return \TYPO3\CMS\Extbase\Mvc\Web\Response
29 */
30 public function handleRequest()
31 {
32 $request = $this->requestBuilder->build();
33 /** @var \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response */
34 $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
35 $this->dispatcher->dispatch($request, $response);
36 return $response;
37 }
38
39 /**
40 * This request handler can handle a web request invoked by the backend.
41 *
42 * @return bool If we are in backend mode TRUE otherwise FALSE
43 */
44 public function canHandleRequest()
45 {
46 return $this->environmentService->isEnvironmentInBackendMode() && !Environment::isCli();
47 }
48 }