[TASK] Use fully qualified name resolution in PHP 5.5
[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 * A request handler which can handle web requests invoked by the backend.
18 */
19 class BackendRequestHandler extends AbstractRequestHandler {
20
21 /**
22 * Handles the web request. The response will automatically be sent to the client.
23 *
24 * @return \TYPO3\CMS\Extbase\Mvc\Web\Response
25 */
26 public function handleRequest() {
27 $request = $this->requestBuilder->build();
28 /** @var $response \TYPO3\CMS\Extbase\Mvc\ResponseInterface */
29 $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
30 $this->dispatcher->dispatch($request, $response);
31 return $response;
32 }
33
34 /**
35 * This request handler can handle a web request invoked by the backend.
36 *
37 * @return bool If we are in backend mode TRUE otherwise FALSE
38 */
39 public function canHandleRequest() {
40 return $this->environmentService->isEnvironmentInBackendMode() && !$this->environmentService->isEnvironmentInCliMode();
41 }
42 }