[TYPO3-core] RFC: #9372: Code in class.tx_tstemplateanalyzer.php don't match with the new CGL
Martin Kutschker
masi-no at spam-typo3.org
Thu Sep 18 09:21:47 CEST 2008
Stefano Kowalke schrieb:
> Masi wrote:
>> You forgot to convert " to ' for simple strings.
>
> Ideed, fixed.
>
>> main() has a lot's of global stuff that can be removed as well.
>
>
> You mean this two lines?
>
>> global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT
> $TYPO3_CONF_VARS;
>> global $tmpl,$tplRow,$theConstants,$rootLine;
>
>
> Changing eg. $BACK_PATH into $GLOBALS['BACK_PATH'], right?
Yes. Or at least checking if $CLIENT is used in main(). I doubt that. I
guess that an empty main() class has been copied everytime Kasper (?)
created a new BE modul. And the kickstarter used to create such code as
well. But IIRC usung $GLOBAL[] is the CGL way to use globals.
> But i don't no how to handle the last constant at first line:
> $TYPO3_CONF_VARS which was used at end of file for the XCLASS.
A "global" declaration is local to the function. So how can main()'s
"global" affect the XCLASS code at the end of the file?
> And clould/should i use $GLOBALS[] for the second line too:
> $GLOBALS['$tmpl'] ?
Ouch. I say yes. Can't sayy I like it that the modules interact via
global variables, but if you change it, it's more prominent. Just in
case anyone wants to fiddle with the code later on.
Masi
More information about the TYPO3-team-core
mailing list