[TYPO3-core] phpversion() vs PHP_VERSION
Michael Stucki
michael at typo3.org
Tue Jun 6 14:56:24 CEST 2006
Hi Martin,
I didn't know about version_compare() yet and was just working on a
replacement of the int_from_ver() function.
Seems like it makes more sense to mark int_from_ver() as deprecated and use
version_compare() for testing version requirements instead. There is just
one problem:
echo version_compare('4.1rc4', '4.1beta3', 'le') ? 'yes' : 'no';
Why does this return "yes"?
- michael
Martin Kutschker wrote:
> Michael Stucki schrieb:
>> Hi Martin,
>>
>>> Which one to use? We use both methods in the Core. Is one of them
>>> preferred or has a (dis)advantage over the other?
>>
>> You probably mean $TYPO_version against TYPO3_version, right?
>>
>> I recommend to use the constant because a) it can't be changed, and b)
>> because the name of the variable is wrong.
>>
>> Probably you should mark the old variable as deprecated.
>
> Done.
>
> I've also unified the two checks for PHP5: the one for iconv and the
> other for the compatibility file.
>
> Attached is the diff of the change.
>
> And here I am again with my ideas for version numbers of TYPO3 in the CVS:
>
> Branch TYPO3_4-0:
>
> define('TYPO3_version', '4.0.1-CVS'); // now!!!
> // after 4.0.1 is out this will be 4.0.2-CVS
> define('TYPO3_branch', '4.0-CVS');
>
> Branch HEAD:
>
> define('TYPO3_version', '4.1.0-CVS');
> define('TYPO3_branch', '4.1-CVS');
>
> Instead of "CVS" we could use "dev" to be a bit more compatible to
> version_compare(). Any version with "dev" will be considered smaller
> than the version without (eg 4.1.0-dev < 4.1.0-alpha < < 4.1.0-beta <
> 4.1.0-RC < < 4.1.0)
>
> Without this change the version number will lack behind, instead of
> advance.
>
> At least the version number in CVS should be different for both branches!
>
> Masi
--
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
More information about the TYPO3-team-core
mailing list