[pmwiki-users] version filter

Patrick R. Michaud pmichaud at pobox.com
Thu Mar 23 07:47:12 CST 2006


[Catching up on emails... --Pm]

On Fri, Mar 17, 2006 at 02:05:46PM +0000, Hans wrote:
> Do we have an accepted way of providing conditional filtering based on
> version numbers, to apply in a recipe script different code for
> different pmwiki versions?

Each release of PmWiki has a $VersionNum variable, that is guaranteed
to always increase with each release.  (It doesn't always increase
by 1, but it always increases.)

The release number is 2xxxyyy, where xxx is the major revision number
and yyy is the minor revision number.  Thus 2.0.13 had a $VersionNum
of 2000013, 2.1.beta32 was 2000932, and 2.1.3 is 2001003.

So, if you need code that applies only to versions of PmWiki prior to
2.1.0, one can do:

    if ($VersionNum < 2001000) { ... }

Pm




More information about the pmwiki-users mailing list