On Sun, 16 Sep 2001, Jani Taskinen wrote:

>
> I was thinking of PEAR too, don't worry. :)
> But the versioning scheme/rules for PHP must be strict.
>
> Consider following:
>
> We have a numeric version constant:
>
> PHP_VERSION_NUM
>
> the value for this is calculated with this simple formula:
>
> v.m.b = v * 10000 + m * 100 + b
>
> v = Changes only when there are big BC breaking changes or when there are
>     big portions of code rewritten, deprecated functions removed,
>     functions behaviour changed..etc.
> m = Changes only when new functionality is added.
> b = Bug fixes ONLY. No new functions added. No API changes.
>
> examples:
>
> 4.0.7 = 40000 + 0 + 7  = 40007
> 4.1.1 = 40000 + 100 + 1 = 40101
>
>
> Having PHP_VERSION_NUM would allow PEAR modules (or any other PHP
> script) to check the version. For example:
>
> Module A depends on functions added in version 4.3.2. They could use
> something like this:
>
> if(PHP_VERSION_NUM < 40302 || PHP_VERSION_NUM > 50000) {
>   die("Incorrect PHP version.");
> }
>
> Now if we would follow the rules for versioning set above, they could
> also _trust_ that this check would always work. As there could not
> be any BC breaking changes between major numbers. (e.g. 4.0.0 < x < 5.0.0)
>
> And also the extensions must follow the same rules as the core PHP.
> ie. every extension defines it's own version number, calculated with same
> formula:
>
> GD_EXT_VERSION = 30201
>
> Now someone can step forward and tell me that this is already possible.
> If not, then I would like to know if all of the developers agree on this.
> And if not, WHY. :)
>

    +1, perhaps from an api perspective we could have something like:

    $vn = php_get_version(GD);

    or if the argument is empty, return the main php version:

    $phpVer = php_get_version();

    -Sterling


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to