Commit 39e1c45d authored by Christian Kuhn's avatar Christian Kuhn Committed by Benni Mack
Browse files

[!!!][TASK] Remove deprecated extbase request related code

* TYPO3\CMS\Extbase\Mvc\Request->getBaseUri()
* TYPO3\CMS\Extbase\Mvc\Request->getRequestUri()
* TYPO3\CMS\Extbase\Mvc\Exception\InvalidRequestMethodException
* TYPO3\CMS\Extbase\Mvc\Web\ReferringRequest

Resolves: #96246
Related: #94367
Related: #94231
Related: #94228
Related: #94223
Releases: main
Change-Id: I3d8019ba2a4535d2886f6876feba123d005f9964
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72512

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 6bcb9105
......@@ -30,9 +30,11 @@ The following PHP classes that have previously been marked as deprecated for v11
- :php:`\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository`
- :php:`\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository`
- :php:`\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext`
- :php:`\TYPO3\CMS\Extbase\Mvc\Exception\InvalidRequestMethodException`
- :php:`\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException`
- :php:`\TYPO3\CMS\Extbase\Mvc\View\AbstractView`
- :php:`\TYPO3\CMS\Extbase\Mvc\View\EmptyView`
- :php:`\TYPO3\CMS\Extbase\Mvc\Web\ReferringRequest`
- :php:`\TYPO3\CMS\Extbase\Object\Container\Container`
- :php:`\TYPO3\CMS\Extbase\Object\Container\Exception\UnknownObjectException`
- :php:`\TYPO3\CMS\Extbase\Object\Exception`
......@@ -93,6 +95,8 @@ The following PHP class methods that have previously been marked as deprecated f
- :php:`\TYPO3\CMS\Extbase\Mvc\Controller\ActionController->buildControllerContext()`
- :php:`\TYPO3\CMS\Extbase\Mvc\Controller\ActionController->getControllerContext()`
- :php:`\TYPO3\CMS\Extbase\Mvc\Controller\ActionController->forward()`
- :php:`\TYPO3\CMS\Extbase\Mvc\Request->getBaseUri()`
- :php:`\TYPO3\CMS\Extbase\Mvc\Request->getRequestUri()`
- :php:`\TYPO3\CMS\Extbase\Mvc\Request->isDispatched()`
- :php:`\TYPO3\CMS\Extbase\Mvc\Request->setDispatched()`
- :php:`\TYPO3\CMS\Extbase\Mvc\View\JsonView->setControllerContext()`
......
<?php
declare(strict_types=1);
/*
* 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.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Extbase\Mvc\Exception;
use TYPO3\CMS\Extbase\Mvc\Exception;
/**
* An "Invalid Request Method" exception
* @deprecated since v11, will be removed in v12
*/
class InvalidRequestMethodException extends Exception
{
}
......@@ -20,8 +20,6 @@ namespace TYPO3\CMS\Extbase\Mvc;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Http\NormalizedParams;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Extbase\Error\Result;
......@@ -419,36 +417,6 @@ class Request implements ServerRequestInterface, RequestInterface
return $this->getExtbaseAttribute()->getInternalArgument($argumentName);
}
/**
* Deprecated methods of extbase Request for v11 compat.
*/
/**
* @deprecated since v11, will be removed in v12.
*/
public function getRequestUri()
{
trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0', E_USER_DEPRECATED);
/** @var NormalizedParams $normalizedParams */
$normalizedParams = $this->getAttribute('normalizedParams');
return $normalizedParams->getRequestUrl();
}
/**
* @deprecated since v11, will be removed in v12.
*/
public function getBaseUri()
{
trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0', E_USER_DEPRECATED);
/** @var NormalizedParams $normalizedParams */
$normalizedParams = $this->getAttribute('normalizedParams');
$baseUri = $normalizedParams->getSiteUrl();
if (ApplicationType::fromRequest($this)->isBackend()) {
$baseUri .= TYPO3_mainDir;
}
return $baseUri;
}
/**
* Methods implementing ServerRequestInterface
*/
......
<?php
/*
* 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.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Extbase\Mvc\Web;
use TYPO3\CMS\Extbase\Mvc\Request;
/**
* Represents a referring web request.
*
* @deprecated since v11, will be removed in v12. Create a ForwardResponse instead, see ActionController->forwardToReferringRequest()
*/
class ReferringRequest extends Request
{
public function __construct($request = null)
{
trigger_error(__CLASS__ . ' will be removed in TYPO3 v12, use ForwardResponse instead, see ActionController->forwardToReferringRequest().', E_USER_DEPRECATED);
parent::__construct($request);
}
/**
* Sets the value of the specified argument
*
* @param string $argumentName Name of the argument to set
* @param mixed $value The new value
*/
public function setArgument($argumentName, $value)
{
parent::setArgument($argumentName, $value);
switch ($argumentName) {
case '@extension':
$this->getExtbaseAttribute()->setControllerExtensionName($value);
break;
case '@controller':
$this->getExtbaseAttribute()->setControllerName($value);
break;
case '@action':
$this->getExtbaseAttribute()->setControllerActionName($value);
break;
case '@format':
$this->getExtbaseAttribute()->setFormat($value);
break;
}
}
}
......@@ -1667,6 +1667,7 @@ return [
'TYPO3\CMS\Extbase\Mvc\Exception\InvalidRequestMethodException' => [
'restFiles' => [
'Deprecation-94231-DeprecateExtbaseInvalidRequestMethodException.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Core\Service\AbstractService' => [
......@@ -1678,6 +1679,7 @@ return [
'TYPO3\CMS\Extbase\Mvc\Web\ReferringRequest' => [
'restFiles' => [
'Deprecation-94367-ExtbaseReferringRequest.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Extbase\Object\ObjectManager' => [
......
......@@ -4837,6 +4837,7 @@ return [
'maximumNumberOfArguments' => 0,
'restFiles' => [
'Deprecation-94223-ExtbaseRequest-getBaseUri.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Extbase\Mvc\Request->getRequestUri' => [
......@@ -4844,6 +4845,7 @@ return [
'maximumNumberOfArguments' => 0,
'restFiles' => [
'Deprecation-94228-DeprecateExtbaseRequestGetRequestUri.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Extbase\Object\ObjectManager->getEmptyObject' => [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment