c6d047ae878b08133c369707327450cb8dcee7b4
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 10.2 / Deprecation-89718-LegacyPageTSconfigParsingLowlevelAPI.rst
1 .. include:: ../../Includes.txt
2
3 ==============================================================
4 Deprecation: #89718 - Legacy PageTSconfig parsing lowlevel API
5 ==============================================================
6
7 See :issue:`89718`
8
9 Description
10 ===========
11
12 Two new PHP API classes for retrieving and parsing TsConfig are
13 introduced:
14
15 - :php:`TYPO3\CMS\Core\Configuration\Loader\PageTsConfigLoader`
16 - :php:`TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser`
17
18 As this API is more consistent, and flexible, as well as agnostic
19 of the current Context of backend or frontend, the following
20 functionality has been marked as deprecated:
21
22 - :php:`TYPO3\CMS\Core\Configuration\TsConfigParser`
23 - :php:`TYPO3\CMS\Backend\Utility\BackendUtility::getRawPagesTSconfig()`
24
25
26 Impact
27 ======
28
29 Instantiating the PHP class or the mentioned PHP method will trigger
30 a deprecation message.
31
32
33 Affected Installations
34 ======================
35
36 TYPO3 Installations with extensions using the lowlevel API for handling PageTSconfig.
37
38
39 Migration
40 =========
41
42 Loading and parsing PageTSconfig on a low-level should be done via the new PHP classes:
43
44 - :php:`TYPO3\CMS\Core\Configuration\Loader\PageTsConfigLoader`
45 - :php:`TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser`
46
47 Usages for fetching all available PageTS of a page/rootline in one large string:
48
49 :php:
50 $loader = GeneralUtility::makeInstance(PageTsConfigLoader::class);
51 $tsConfigString = $loader->load($rootLine);
52
53
54 The string is parsed (and conditions are applied) with the Parser::
55
56 $parser = GeneralUtility::makeInstance(
57 PageTsConfigParser::class,
58 $typoScriptParser,
59 $hashCache
60 );
61 $pagesTSconfig = $parser->parse(
62 $tsConfigString,
63 $conditionMatcher
64 );
65
66 Extension developers should rely on this syntax rather than
67 on :php:`$GLOBALS['TSFE']->getPagesTSconfig()` or :php:`BackendUtility::getPagesTsConfig()`, or the deprecated method / class.
68
69 .. index:: PHP-API, TSConfig, FullyScanned, ext:core