Is this needed? Could older pages use incompatible plugins etc.?
--
DavidLeBlanc - 13 Mar 2001
I agree, I propose that:
- we add to all modules a VARIABLE version
- the
initPlugin handler checks all dependencies and
- return
true if the initialization is OK
- return
false if something went wrong
- the plugin initialization code DON'T register a plugin that returns false (or that has no
initPlugin handler)
--
AndreaSterbini - 27 Mar 2001
Yes, we should do that, and it should go into the
TWikiReleaseSpring2001.
--
PeterThoeny - 27 Mar 2001
Just a couple of other questions:
- should we use a major*1000+minor*100+minimum version scheme
- $TWiki::VERSION = 1324 (meaning 1.3.24)
- or a simple count starting with 1?
- $TWiki::VERSION = 1
- $TWiki::Plugins::VERSION = 1
- $TWiki::Plugins::CalendarPlugin::VERSION = 1
- or a different (perlish) way?
- $TWiki::VERSION = v1.3.6
- $TWiki::Plugins::VERSION = v1.5.3
- $TWiki::Plugins::CalendarPlugin::VERSION = v0.2.4
... and so on?
The first two version allows me to put in the init sub (let say
TWiki::Plugins::CalendarPlugin::initPlugin ) a test like:
if ($TWiki::VERSION < 2 || $TWiki::Plugins::VERSION < 3 ) {
return 0;
}
Please, Perl gurus, share with me your wisdom on handling Versions "the Perl way".
--
AndreaSterbini - 27 Mar 2001
(I prefer the dotted notation: 1.x.x instead of 1xx as above in Andreas' commment. "1xx" could too easily be mistaken for a microsoftish build number imho.)
How about the usual convention that as long as any major number doesn't change, then the plugin is compatible. I.E. any 1.xx plugin will work with any 1.xx TWiki. (This implies some discipline on the part of developers to ensure that new features either don't break existing plugins
or that the major version number changes if it does.)
Also, in the Tcl world, there is the notion of a 'package', (think 'module') and one includes a package by "package requre foo 1.4"; so long as there is that version or later (including a 2.x etc. version), the request is satisfied. A flag to the package function is "-exact" which means "that version and only that version": "package require -exact foo 1.4". (N.B. In Tcl, one can have several versions of the same package since a package version lives in a directory called packagenameMM.mm ("./foo1.4") and the package itself will be just named package.tcl in that directory. (There is a nify resolution mechanism, but that's not relevent here I think.)
An inverse way to do it would be for the plugin to say which version(s) of TWiki it's ok with...
This is just food for thought - i'm not perlized enough to know if this is either feasible or "the Perl way".
--
DavidLeBlanc - 30 Mar 2001
I have just added the variable $VERSION='1.000' to TWiki::Plugins.pm and to default plugins.
--
AndreaSterbini - 29 May 2001