[TASK] Streamline TypoScript IncludeTree logic
The patch comes with a couple of changes for the TypoScript IncludeTree construct: * Identifiers are now unique within a tree. This is needed especially in the Backend TypoScript -> Included Template files rendering: Before, showing content of single segments did not work due to duplicate identifiers. * getIdentifier() is hardened to throw an exception if not initialized: This detail is only needed for non-cache analysis purposes and identifiers don't exist when getting trees from cache in Frontend. * To allow file includes relative to a parent file include, they now have a "path" property that is properly hand over to child includes. Relative child includes now work with include_static sys_template includes as well. * RootInclude now has an identifier as well to seed child includes which include the parent identifier in their hash. * Identifier hashes and cache identifiers are built with fast xxh3 hash in favor of sha1() and json_encode() is used in favor of serialize() when hashing structures, if possible. * Identifier hashes are created in the setter instead of calling hash() in the caller. * [end] and [global] lines are now parts of the previous condition segment and don't create one-line segments anymore. * Tests are adapted to be a bit less noisy on properties we're not interested in by using another custom comparator. Change-Id: I9c03edfcf29e2887c0ef70ce1692582524333bdf Resolves: #99537 Related: #97816 Releases: main Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77369 Reviewed-by:Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
core-ci <typo3@b13.com>
Showing
- typo3/sysext/core/Classes/TypoScript/IncludeTree/IncludeNode/AbstractInclude.php 20 additions, 2 deletions...es/TypoScript/IncludeTree/IncludeNode/AbstractInclude.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/IncludeNode/IncludeInterface.php 20 additions, 2 deletions...s/TypoScript/IncludeTree/IncludeNode/IncludeInterface.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/IncludeNode/RootInclude.php 0 additions, 6 deletions...lasses/TypoScript/IncludeTree/IncludeNode/RootInclude.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/StringTreeBuilder.php 2 additions, 1 deletion...core/Classes/TypoScript/IncludeTree/StringTreeBuilder.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/SysTemplateTreeBuilder.php 39 additions, 35 deletions...Classes/TypoScript/IncludeTree/SysTemplateTreeBuilder.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/TreeFromLineStreamBuilder.php 100 additions, 47 deletions...sses/TypoScript/IncludeTree/TreeFromLineStreamBuilder.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/TsConfigTreeBuilder.php 4 additions, 2 deletions...re/Classes/TypoScript/IncludeTree/TsConfigTreeBuilder.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/Visitor/IncludeTreeConditionIncludeListAccumulatorVisitor.php 1 addition, 0 deletions...tor/IncludeTreeConditionIncludeListAccumulatorVisitor.php
- typo3/sysext/core/Classes/TypoScript/PageTsConfigFactory.php 2 additions, 1 deletiontypo3/sysext/core/Classes/TypoScript/PageTsConfigFactory.php
- typo3/sysext/core/Tests/Functional/TypoScript/IncludeTree/IncludeTreeObjectIgnoringIdentifierAndPathComparator.php 41 additions, 0 deletions.../IncludeTreeObjectIgnoringIdentifierAndPathComparator.php
- typo3/sysext/core/Tests/Functional/TypoScript/IncludeTree/TreeFromLineStreamBuilderTest.php 37 additions, 159 deletions.../TypoScript/IncludeTree/TreeFromLineStreamBuilderTest.php
- typo3/sysext/core/Tests/Functional/TypoScript/IncludeTree/UnserializedIncludeTreeObjectComparator.php 1 addition, 1 deletion...t/IncludeTree/UnserializedIncludeTreeObjectComparator.php
Loading
Please register or sign in to comment