Feature #17536
closedPatch for t3lib/class.t3lib_tsparser.php adding php-HEREDOC like syntax
0%
Description
The TS multiline parenthesis syntax ( ... ) doesn't allow one to define such a multiline text :
config.something (
// this is php that will be eval'd if needed
$res = substr(
"hello world",
0,
5
);
)
As the ");" closing of call to the php function fools the parser, breaking the multiline block.
I implemented a notation similar to php's HEREDOC syntax ( http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc )
So The resulting TS would be:
config.something <<<SOMEPHP
// this is php that will be eval'd if needed
$res = substr(
"hello world",
0,
5
);
SOMEPHP
Note that "SOMEPHP" is variable and defined to whatever the user needs, thus completely avoiding the possibility of end-tag collision with the content.
I checked with TS analyzer and TS syntax highlighting, and patch works fine.
The patch is targeted for v4.1.1 of the file
(issue imported from #M6160)
Files
Updated by Michael Stucki over 17 years ago
There seems to be an error in your description:
SOMEPHP
I'm quite sure the ">>>" are not needed! Does your patch do it the right way?
Updated by Michael Stucki over 17 years ago
But I must say I like this patch very much. Let's integrate this soon!
If you don't mind, I would be happy if you also can supply the documentation changes needed (should be added to "doc_core_ts").
Regards, michael
Updated by Jerome Schneider over 17 years ago
Actually there's no technical need for end tag to be prefixed with >>>,
But I thought that it's easier to visualy detect, especially when there arelot of lines in the multiline block.
Concerning the doc, I'll update it. What's the procedure ?
With respect,
Jerome
Updated by Michael Stucki over 17 years ago
Well, concerning the end tag, I would like to stick to standards like it is defined on php.net. Your idea is nice, but once we have syntax highlighting integrated with the TypoScript editor, there's no need for that anyway. So I suggest to drop the end tag as it is in PHP.
About documentation: Just post that here, describing where I need to change what, and I will take care of the rest...
Updated by Jerome Schneider over 17 years ago
Hi,
You'll find attached to the Issue the revised version of the patch dropping >>> for the end-tag, and an sxw openoffice doc containing the documentation of the feature, to be inserted in doc_core_ts right after the documentation of multiline ( ) feature.
Regards,
Jerome
Updated by Karsten Dambekalns over 16 years ago
It seems Jerome acted quickly to fulfill the requirements - now this could go into 4.3. :)
Updated by Martin Kutschker over 16 years ago
If you like it propose it on the Core list. But could we change the >>> syntax to something else? It clashes optically with other uses of > in TS. Maybe a (((ENDTAG could be used
Updated by Ernesto Baschny about 14 years ago
Hi Jerome.
I think your improvement is very nice and it might be a candidate to inclusion in 4.5. If you don't mind and have time to work on the issue again, I would be glad. If you have a patch that works with current "trunk" of TYPO3, consider posting it as an RFC to the core list.
Thanks for your help!
Updated by Jerome Schneider about 14 years ago
Hi Ernesto,
I'll be glad to help. I'll rebuild the patch and submit the aforementioned RFC.
Updated by Xavier Perseguers over 13 years ago
- Target version deleted (
4.6.0-beta1)
Updated by Alexander Opitz over 11 years ago
Hi,
this issue is very old, does it still exists with newer versions of TYPO3 CMS (4.5 or 6.1)?
What happened to the patch?
Updated by Alexander Opitz over 11 years ago
- Category set to TypoScript
- Status changed from Needs Feedback to New
Updated by Mathias Schreiber almost 10 years ago
- Target version set to 7.2 (Frontend)
Updated by Benni Mack over 9 years ago
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Sybille Peters over 6 years ago
Thank you for your report.
Even though it has been some time, would you consider checking if your patch idea is still up to date and upload it to our Gerrit review server?
Someone could do this for you, but I am thinking you might like the opportunity to contribute to TYPO3 yourself.
You can find a description of the TYPO3 contribution workflow here: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/
Hint: If you get stuck anywhere, ask on Slack in the #typo3-cms-coredev channel. You can register in the TYPO3 slack workspace here: https://forger.typo3.com/slack
Thank you in advance!
Updated by Benni Mack over 4 years ago
Hey everybody,
I'm closing this issue now: TypoScript won't be receiving a lot of new features in the future, I suspect. We've modernized most of our codebase to fluid or other engines, which makes the TypoScript configuration language "stale" to not have this evolved further. Adding more lines of code is now not such an issue anymore since the fix (already in v4.x) that the closing ")" is detected properly. HEREDOC and NEWDOC (not escaping " or ') are not really a priority (also in PHP) anymore.