[TYPO3-dev] Detecting the version of Typo3 for my extensio

Christian Trabold trabold at mehrwert.de
Fri May 19 17:46:09 CEST 2006


Hi Ingo,
Hi Tapio,

>>I would need condition if($TypoVer >= 4.0)
>>
>>how I could get the version of Typo3?
> 
> 
> $version =
> $GLOBALS['TYPO3_VERSION']?$GLOBALS['TYPO3_VERSION']:$GLOBALS['TYPO_VERSION'];
> 
> always use $GLOBALS['TYPO3_VERSION']

no. see below.


> but as this variable is not available in older versions you need to check
> for it and use $GLOBALS['TYPO_VERSION'] in case it is an old version and
> thus not available.

There is a constant TYPO3_version which you should use (according to 
TYPO3 Core APIs Page 46 - PDF) - combined with the API call 
t3lib_div::int_from_ver($version) you'll get a reliable value to work with.

eg

if (t3lib_div::int_from_ver(TYPO3_version) < 4000000) {
   debug('TYPO3 4.0 required!');
}



Regards,

Christian




More information about the TYPO3-dev mailing list