Re: Re: [RFC] PHP_Compat, MIME_Type & mime_content_type
| From: | Klaus Guenther | Date: | Tue, 28 Jun 2005 11:51:28 +0000 |
| Subject: | Re: Re: [RFC] PHP_Compat, MIME_Type & mime_content_type | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-38351@lists.php.net to get a copy of this message | ||
On 6/27/2005 7:45 PM, Justin Patrin spake the following words:
> On 6/27/05, Joe Stump <joe@joestump.net> wrote:
>
>>I'm confused. Can't authors simply require a specific version of PHP?
>>I haven't looked over the package.xml specs in a while, but shouldn't
>>I be able to say "If $version < 4.2, then require PHP_Compat"? I
>>should at least be able to say "I see you like running old, buggy and
>>potentially exploitable versions of PHP, in order to run this package
>>or parts of this package you will need to install PHP_Compat".
>
> I'm not a package.xml expert so I can't answer the question, but the
> idea is ok. If package.xml does support this then we can allow this. I
> still don't really like it, though. This is why packages have PHP
> dependencies. You have to have a certain version to run it. If a user
> decides to use a lower version it's their responsibility to bring
> their installation up to a recent version of use PHP_Compat to *try*
> to bring it up.
>
> However, as I said, a conditional dependency would be ok here but only
> if the minimum PHP version dep is thoroughly tested by the package
> maintainer. It would also make sense in this case for the package
> itself to include the PHP_Compat functions, but this needs to be done
> correctly. PHP_Compat's function loading function should definately be
> used at the least.
Then the correct thing to do would be to check when loading the driver
(or whatever other file) what version of php is running and
conditionally require PHP_Compat and then again conditionally use the
PHP_Compat loading function... Otherwise, PHP_Compat will have to be
required in all installations, which imho is not a good thing at all.
The problem I see with Helgi's solution (simple though it is), is that
if there's a bug in the PHP_Compat code and PHP_Compat gets upgraded...
you'll have to release, too :) So... that's additional maintinance as
well as code duplication. And since we're trying to avoid these two
things in PEAR, why not have fine-tuned conditional dependency? :)
Klaus