Deprecation: #89718 - Legacy PageTSconfig parsing lowlevel API
See forge#89718
Description
Two new PHP API classes for retrieving and parsing TsConfig are introduced:
\TYPO3\
CMS\ Core\ Configuration\ Loader\ Page Ts Config Loader \TYPO3\
CMS\ Core\ Configuration\ Parser\ Page Ts Config Parser
As this API is more consistent, and flexible, as well as agnostic of the current Context of backend or frontend, the following functionality has been marked as deprecated:
\TYPO3\
CMS\ Core\ Configuration\ Ts Config Parser TYPO3\
CMS\ Backend\ Utility\ Backend Utility:: get Raw Pages TSconfig ()
Impact
Instantiating the PHP class or the mentioned PHP method will trigger a deprecation message.
Affected Installations
TYPO3 Installations with extensions using the lowlevel API for handling PageTSconfig.
Migration
Loading and parsing PageTSconfig on a low-level should be done via the new PHP classes:
\TYPO3\
CMS\ Core\ Configuration\ Loader\ Page Ts Config Loader \TYPO3\
CMS\ Core\ Configuration\ Parser\ Page Ts Config Parser
Usages for fetching all available PageTS of a page/rootline in one large string:
$loader = GeneralUtility::makeInstance(PageTsConfigLoader::class);
$tsConfigString = $loader->load($rootLine);
The string is parsed (and conditions are applied) with the Parser:
$parser = GeneralUtility::makeInstance(
PageTsConfigParser::class,
$typoScriptParser,
$hashCache
);
$pagesTSconfig = $parser->parse(
$tsConfigString,
$conditionMatcher
);
Extension developers should rely on this syntax rather than
on $GLOBALS
or Backend
, or the deprecated method / class.