[TASK] Use fully qualified name resolution in PHP 5.5
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / Web / FrontendRequestHandler.php
index 1ace107..e46349f 100644 (file)
@@ -1,73 +1,42 @@
 <?php
 namespace TYPO3\CMS\Extbase\Mvc\Web;
 
-/***************************************************************
- *  Copyright notice
- *
- *  This class is a backport of the corresponding class of TYPO3 Flow.
- *  All credits go to the TYPO3 Flow team.
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
+/**
+ * This file is part of the TYPO3 CMS project.
  *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
  *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
  *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
+ * The TYPO3 project - inspiring people to share!
+ */
 /**
  * A request handler which can handle web requests invoked by the frontend.
  */
-class FrontendRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHandler {
+class FrontendRequestHandler extends AbstractRequestHandler {
 
        /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        * @inject
         */
        protected $configurationManager;
 
        /**
         * @var \TYPO3\CMS\Extbase\Service\ExtensionService
+        * @inject
         */
        protected $extensionService;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
-        */
-       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
-               $this->configurationManager = $configurationManager;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
-        * @return void
-        */
-       public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
-               $this->extensionService = $extensionService;
-       }
-
-       /**
         * Handles the web request. The response will automatically be sent to the client.
         *
         * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface|NULL
         */
        public function handleRequest() {
                $request = $this->requestBuilder->build();
-               /** @var $requestHashService \TYPO3\CMS\Extbase\Security\Channel\RequestHashService */
-               $requestHashService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Security\\Channel\\RequestHashService');
-               $requestHashService->verifyRequest($request);
                if ($this->extensionService->isActionCacheable(NULL, NULL, $request->getControllerName(), $request->getControllerActionName())) {
                        $request->setIsCached(TRUE);
                } else {
@@ -80,7 +49,7 @@ class FrontendRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestH
                        $request->setIsCached(FALSE);
                }
                /** @var $response \TYPO3\CMS\Extbase\Mvc\ResponseInterface */
-               $response = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
+               $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
                $this->dispatcher->dispatch($request, $response);
                return $response;
        }
@@ -88,13 +57,9 @@ class FrontendRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestH
        /**
         * This request handler can handle any web request.
         *
-        * @return boolean If the request is a web request, TRUE otherwise FALSE
+        * @return bool If the request is a web request, TRUE otherwise FALSE
         */
        public function canHandleRequest() {
-               return TYPO3_MODE === 'FE';
+               return $this->environmentService->isEnvironmentInFrontendMode();
        }
-
 }
-
-
-?>
\ No newline at end of file