[TYPO3-dev] Official coding guidelines of TYPO3
Franz Holzinger
franz at ttproducts.de
Fri Apr 24 10:00:36 CEST 2009
Dmitry Dulepov a écrit :
>> Why we don`t use $GLOBALS[...] in the global scope, too? In my opinion,
>
> You can but it is not required. It is shorter to use $TYPO3_CONF_VARS :)
The CGL says: "Use of global is not recommended. Always use
$GLOBALS['variable']."
But why do you recommend the longer way to use $GLOBALS['TYPO3_CONF_VARS
'] instead of $TYPO3_CONF_VARS? Maybe it is because 'global'
declarations might not work in some cases.
It is easier to write and read if the variable names are shorter.
And it causes red code warnings in the EM if you follow the Coding
Guidelines:
No XCLASS inclusion code found in file "lib/class.tx_extkey_filename.php"
- Franz
More information about the TYPO3-dev
mailing list