Feature #15778
closedProposal for constant "TYPO3_compat_version"
0%
Description
Hello!
What do you think about a constant like for example "TYPO3_version_compat" or "TYPO3_compat_version" - or even "compatVersion" if you want to get it in sync with the TypoScript-Condition - that developers could build on in own Extensions.
IMHO there is just "TYPO3_version" for the "real" TYPO3-Version-Number and the "TYPO3_branch", but no no direct way to access the current compat version via a constant.
[OK "$TYPO3_CONF_VARS['SYS']['compat_version']" if you like playing with long var names ;)]
Does it make sense to you to introduce such a new constant?
/*
A quick hack to demonstrate this. Add to config_default.php:
*/
require(PATH_typo3conf.'localconf.php');
$cVersion = t3lib_div::int_from_ver($TYPO3_CONF_VARS['SYS']['compat_version']);
$rVersion = t3lib_div::int_from_ver(TYPO3_version);
if (!empty($cVersion) && ($cVersion != $rVersion)) {
// if compat version is set take that
$compatVersion = $TYPO3_CONF_VARS['SYS']['compat_version'];
} else {
// take regular version as compat version - for the developer everything stays as it is
$compatVersion = TYPO3_version;
}
define('TYPO3_compat_version', $compatVersion);
(issue imported from #M2789)
Updated by Michael Stucki over 18 years ago
Sebastian, could you please have a look at this?
Updated by Ernesto Baschny over 18 years ago
I don't think we need a constant for that. There is t3lib_div::compat_version method that can be used to do such kind of "condition checks" in your extensions.
Updated by Michael Stucki over 18 years ago
Finally I agree, so let's close this bug until other arguments pop in...