From: Erin S. <ebu...@sq...> - 2002-12-04 00:17:13
|
> [Dropped squirrelmail-plugins from Cc:] > > On Mon, 2 Dec 2002 22:14:45 -0800 > "p dont think" <pdo...@an...> wrote: > > In the function, after this line: >> list($aa, $bb, $cc) = preg_split('/\./', $version, 3); > > one can also add something like > > if(!is_numeric($cc)) { > list($cc, $info) = explode(" ", $cc, 2); > } > > to take into account the case where it might actually be $version = > "1.3.6 [CVS-DEVEL]" or "1.4.8 [CUSTOMIZED-BLAH-BLAH]". > > And then, why not, implement some checking with the string in the > brackets [] for some customized installations probably... > > Cheers, > Alex I have a better idea. Since 1.2.x etc. is technically "back-level", why don't we create, for the 1.3.x -> 1.4/1.5 streams, a global variable that is some unique version identifier. That is, global $sm_internal_version = 010030004 or something like that. This allows us to keep the pretty version strings we have now (complete with CVS indicators, etc.) while not incurring excess overhead just to check if the version is new. Thing is, if we add the new function, it wouldn't be added to previous versions (1.2.8, 1.2.7... ). This way, you can just do the following in your plugins (in order to use the new function, etc..): global $sm_internal_version; if ( isset($sm_internal_version) ) { /* we have newer code - will have new version checking function, we also know that we have SM_PATH, etc., here */ } else { /* we're in 1.2.x, no SM_PATH, no version checking */ } It's fairly simple, and requires no change to the stable stream or other previous versions, which I think makes more sense. Since devel is still the devel stream, we can require people to move up. I don't think we can make the same requirement (or, rather, I don't think it's practical to make the same requirement) for a 'stable' release - especially the latest stable release. Erin (ebullient - aka 'The Mother Nut', co-leader of devel) -- 'Waste of a good apple.' - Samwise Gamgee ICQ: 38670353 |