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

Tapio Markula tapio.markula at dnainternet.net
Fri May 19 19:27:30 CEST 2006


> Ok. I might use it in some other case. I needed version info as a global 
> variable in several places for many functions and I can't set 
> stand-alone if-statement inside a class.
> 
> This works outside class as a global variable even if it is not very smart
> 
> if(intval(substr($GLOBALS['TYPO_VERSION'],0,1)>3))
>     $Typo4=1;
> 
> it doesn't matter, if some Typo3 version doesn't use that variable 
> because the purpose is return true only if typo3 version is bigger than 3x

What could be smart is a class methor for that
function checkIfTypo4(){

if (t3lib_div::int_from_ver(TYPO3_version) < 4000000)
	return true;

else
	return false;
}
....

function ...
if($this->checkIfTypo4())






More information about the TYPO3-dev mailing list