Re: zend module patch - (aka versioning proposal?)

From: Date: Wed, 10 Oct 2001 22:01:48 +0000
Subject: Re: zend module patch - (aka versioning proposal?)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67721@lists.php.net to get a copy of this message
Joao Prado Maia wrote: > > On Wed, 10 Oct 2001, Stig S. Bakken wrote: > > > > The patch also adds a "version" field to the struct, along with a > > > zend_get_module_version Zend API function and an optional parameter to > > > phpversion() for getting the version of a loaded extension. > > > > > > The downside is that moving zend_module_entry's configuration fields > > > first can't be done in a backwards-compatible way. This patch breaks > > > every extension out there (except ext/standard, which is updated), but > > > it does buy us better BC possibilities in the future. > > > > > > Comments, opinions? > > Yes, I have one question about your proposed change. My C programming is > very rusty, but I can see that you are treating the version information as > a plain string (maybe I'm wrong). > > If this is true, how would we check against a minor version of an > extension, as to be able to detect a specific version that might have a > yet another very specific bugfix / feature ? > > I remember from a few weeks ago Andy talking about maybe creating a new > function that would return the major version number and also the minor and > micro numbers. All of that would be very helpful to create portable code > that could check the available features that it needs. > > I would ask Jani to step on this discussion that moved from just a API > breakage change to a Versioning scheme proposal. :) > > We definetly need more information than just a string containing the > version of an extension. Andi basically suggested a capabilities system, but I don't think we should do that now, for several reasons, most importantly that it's much more complex than a simple versioning scheme. Another point I think is important is that with a capabilities scheme, you depend on the author having defined the capabilities you need (maybe he didn't think of the little difference that matters to you), while with a simple scheme it's all up to you. It will take a lot of trying and failing to model a capabilities system, the simple scheme may be kinda dumb, but it will work right away. Anyway, there are functions for comparing version numbers now, I can add one that returns a normalized representation as well (for example an associative array in a PHP function, or a struct in a C function). Having it as a string in the module struct is the most practical solution IMHO. - Stig

« previous php.dev (#67721) next »