[FEATURE] Introduce new @import syntax for TS includes 46/54446/6
authorBenni Mack <benni@typo3.org>
Thu, 19 Oct 2017 14:27:16 +0000 (16:27 +0200)
committerBenjamin Kott <benjamin.kott@outlook.com>
Fri, 20 Oct 2017 13:11:21 +0000 (15:11 +0200)
commit0b300b6c23493279d651bc58916f575ebd260c77
tree5c715c848c5eb9eef62d2c1c8b0290f807e2080d
parent6a56da73c142d2d5605afdb19b73f1b22b9a5587
[FEATURE] Introduce new @import syntax for TS includes

The original '<INCLUDE_TYPOSCRIPT...>' syntax is hard to understand,
error-prone and overloaded with features.

This patch introduces a new way to include files based on SymfonyFinder
and simple logic to allow to include files or folders:

The following syntax (leaned towards SASS imports) is added:
Imports one file:

- @import 'EXT:myext/Configuration/TypoScript/myfile.typoscript'

Imports all files in a folder (always sorted by name):
- @import 'EXT:myext/Configuration/TypoScript/*'
- @import 'EXT:myext/Configuration/TypoScript/'

Imports all files ending with ".typoscript":
- @import 'EXT:myext/Configuration/TypoScript/*.typoscript'

Automatically adds '.typoscript' file ending and includes setup.typoscript
- @import 'EXT:myext/Configuration/TypoScript/setup'

This is all done with Symfony Finder to find the files.

Resolves: #82812
Releases: master
Change-Id: I4b64a087ef8c6aa85063c19c1882c9ed3448d9b5
Reviewed-on: https://review.typo3.org/54446
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Markus Sommer <markus.sommer@typo3.org>
Reviewed-by: Markus Sommer <markus.sommer@typo3.org>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php
typo3/sysext/core/Documentation/Changelog/master/Feature-82812-NewSyntaxForImportingTypoScriptFiles.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/FileStreamWrapperTest.php
typo3/sysext/core/Tests/Unit/TypoScript/Fixtures/badfilename.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/TypoScript/Fixtures/recursive_includes_setup.typoscript [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/TypoScript/Fixtures/setup.typoscript [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/TypoScript/Parser/TypoScriptParserTest.php