[TYPO3-dev] [tip] how to let your IDE know about $GLOBALS['TYPO3_DB']

Xavier Perseguers xavier at typo3.org
Thu Mar 20 13:28:05 CET 2014


Hi Stefano,

Stefano Cecere wrote:
> i just want to share this idea (working well! at least under PhpStorm)
> to let your IDE know about the functions of $GLOBALS['TYPO3_DB'] (which
> is an instance of t3lib_DB:
> 
> in my class i add a function like :
> 
>     /**
>      * @return t3lib_DB
>      */
>     protected function getTYPO3_DB()
>     {
>         return $GLOBALS['TYPO3_DB'];
>     }

By convention in Core we named it "getDatabaseConnection" since the
class is now "DatabaseConnection" even though it's still of course
$GLOBALS['TYPO3_DB'].

> i use the same procedure for any other $GLOBAL[] class

Yes, that's what we started to do when refactoring/reworking some parts
since 6.0.

Kind regards

-- 
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the TYPO3-dev mailing list