Notes |
(0000695)
dhaun (administrator)
2009-05-02 03:44
|
Specifically, it looks like any sort of suffix will cause that version number to be considered lower than the version number without the suffix.
I.e. 1.5.2sr4, 1.5.2b1, 1.5.2rc1 are all considered version numbers lower than 1.5.2
I guess we could provide our own function, COM_versionCompare or the like. But what exactly do we want it to return?
Consider: 1.6.0b1 < 1.6.0rc1 < 1.6.0 < 1.6.0sr1 |
|
(0000714)
Ivy (reporter)
2009-05-07 11:03
|
When upgrade: 1.4.1 to 1.5.2sr4, then occured.
from:
if (version_compare(VERSION, '1.5.2') < 0) {
to:
preg_match("/^(\d+\.\d+\.\d+).*$/", VERSION, $match);
if (version_compare($match[1], '1.5.2') < 0) {
It may work. |
|
(0000715)
dhaun (administrator)
2009-05-07 11:13
|
version_compare('1.4.1', '1.5.2sr4') returns -1, so that works as expected. |
|
(0000716)
Ivy (reporter)
2009-05-07 11:58
|
CUSTOM_mail() use version_compare() for working in any version.
CUSTOM_mail works differently in VERSION '1.5.2' '1.5.2sr*' from VERSION '1.4.1'.
CUSTOM_mail:
http://code.google.com/p/geeklog-jp/source/browse/trunk/geeklog-1-jp/system/custom/custom_mail_jp.php |
|
(0000717)
dhaun (administrator)
2009-05-07 14:45
|
Sorry, I don't understand that comment. version_compare works as expected for comparing 1.4.1 and 1.5.2sr4. So what's the problem there?
As I wrote above, it may make sense to have our own version compare function so that you can compare, say, 1.5.2rc1 and 1.5.2sr4 and get a sensible result. But that shouldn't stop you from using version_compare for CUSTOM_mail for now. |
|
(0000719)
Ivy (reporter)
2009-05-08 01:35
|
I see. 'version_compare()' works well in any Geeklog programs, then it's okey. |
|