Project

General

Profile

Actions

Feature #17536

closed

Patch for t3lib/class.t3lib_tsparser.php adding php-HEREDOC like syntax

Added by Jerome Schneider over 16 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2007-08-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

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

heredoc_patch.txt (2.81 KB) heredoc_patch.txt Administrator Admin, 2007-08-16 12:14
patch_heredoc_v2.txt (2.86 KB) patch_heredoc_v2.txt Administrator Admin, 2007-08-16 15:05
doc_core_ts_heredoc.sxw (16.5 KB) doc_core_ts_heredoc.sxw Administrator Admin, 2007-08-16 15:06
Actions #1

Updated by Michael Stucki over 16 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?

Actions #2

Updated by Michael Stucki over 16 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

Actions #3

Updated by Jerome Schneider over 16 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

Actions #4

Updated by Michael Stucki over 16 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...

Actions #5

Updated by Jerome Schneider over 16 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

Actions #6

Updated by Karsten Dambekalns almost 16 years ago

It seems Jerome acted quickly to fulfill the requirements - now this could go into 4.3. :)

Actions #7

Updated by Martin Kutschker almost 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

Actions #8

Updated by Ernesto Baschny over 13 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!

Actions #9

Updated by Jerome Schneider over 13 years ago

Hi Ernesto,
I'll be glad to help. I'll rebuild the patch and submit the aforementioned RFC.

Actions #10

Updated by Xavier Perseguers almost 13 years ago

  • Target version deleted (4.6.0-beta1)
Actions #11

Updated by Alexander Opitz almost 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?

Actions #12

Updated by Ingo Renner almost 11 years ago

yes, still not possible AFAIK

Actions #13

Updated by Alexander Opitz almost 11 years ago

  • Category set to TypoScript
  • Status changed from Needs Feedback to New
Actions #14

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.2 (Frontend)
Actions #15

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Actions #16

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #17

Updated by Benni Mack over 8 years ago

  • Target version deleted (7.5)
Actions #18

Updated by Sybille Peters about 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!

Actions #19

Updated by Benni Mack about 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.

Actions #20

Updated by Benni Mack about 4 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF