Deprecation: #94223 - Extbase Request->getBaseUri()

See Issue #94223

Description

To further prepare extbase towards PSR-7 compatible requests, the extbase TYPO3\CMS\Extbase\Mvc\Request has to be streamlined.

Method getBaseUri() has been deprecated and shouldn’t be used any longer.

Impact

Using the method will log a deprecation message, it will be removed with v12.

Affected Installations

This getter is probably used rather seldom in extensions since both frontend and backend take care of base URI’s in many cases already. The extension scanner will find remaining usages.

Migration

When getBaseUri() is called in extensions, it is most likely in a view related component. Since fluid view helpers currently still don’t receive an instance of the native PSR-7 request (which will change), a typical substitution of this getter looks like this for now:

// @todo Adapt this example as soon as view helpers receive a ServerRequestInterface
$request = $GLOBALS['TYPO3_REQUEST'];
/** @var NormalizedParams $normalizedParams */
$normalizedParams = $request->getAttribute('normalizedParams');
$baseUri = $normalizedParams->getSiteUrl();