[TYPO3-core] phpversion() vs PHP_VERSION

Michael Stucki michael at typo3.org
Tue Jun 6 19:50:17 CEST 2006


Martin Kutschker wrote:

>> No, the EM obviously complains about "4.0" not being good enough for an
>> extension asking for "4.0.0". Doesn't it for you?
> 
> I don't know, but I meant it *should* be treated as a shorthand. IMHO "4",
> "4.0" and "4.0.0" are the same version and should be treated by the EM
> (and int_from_ver as such).

I think the problem is that the values must not be submitted as strings.
Using the floatval() function it works as expected (which seems obvious to
me, somehow...)

Unfortunately, this is not the only problem. See my other mail from this
afternoon. I think it's better to stick with our own function, an improved
version of the int_from_ver() method in t3lib_div.

Attached is a patch that replaces t3lib_div::int_from_ver() with
t3lib_div::flatVersionNumber(). It works as expected with every kind of
version string (4.1-cvs, 4.0.2beta3, etc.).

The big difference compared to the int_from_ver() function is just that it
respects CVS, beta and RC candidates as expected:

4.1-cvs (4.0.2rc3 becomes 4000001.903
4 becomes 4000000

... and finally, those numbers can easily be compared using mathematical
operators <|=|>.

Please have a look at the patch and let me know if you consider it as
useful :-)


Additionally, I suggest to change the version number in TYPO3_4-0 CVS as
follows:

--- t3lib/config_default.php    4 Jun 2006 16:15:06 -0000       1.86.2.29
+++ t3lib/config_default.php    6 Jun 2006 10:47:14 -0000
@@ -247,7 +247,7 @@
 $T3_VAR 
        // TYPO3 version
-$TYPO_VERSION +$TYPO_VERSION  define('TYPO3_version', $TYPO_VERSION);
 define('TYPO3_branch', '4.0');
 define('TYPO3_copyright_year', '1998-2006');


Regards, michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typo3_version_HEAD.diff
Type: text/x-diff
Size: 4008 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060606/510e46e2/attachment.bin 


More information about the TYPO3-team-core mailing list