Deprecation: #109551 - GeneralUtility::getIndpEnv()
See forge#109551
Description
Method
\TYPO3\ has been deprecated.
The method abstracts server environment variables and was used to obtain request-related
data from PHP superglobals such as the current host, URI, or site path. This information is
reliably available via
\TYPO3\, which is attached
as attribute to the PSR-7 request.
Impact
Calling
General triggers a PHP
E_ error.
Affected installations
All installations that call
General directly.
The extension scanner will detect affected usages as a strong match.
Migration
Replace calls to
General with the corresponding
\TYPO3\ getter. A
Normalized instance is available as an attribute of the PSR-7
request:
// Before
$siteUrl = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
$host = GeneralUtility::getIndpEnv('HTTP_HOST');
// After
$normalizedParams = $request->getAttribute('normalizedParams');
$siteUrl = $normalizedParams->getSiteUrl();
$host = $normalizedParams->getHttpHost();