On Mon, 24 Sep 2001, Stanislav Malyshev wrote:

> SH>>
> SH>>     Yes, but it also affects the portability of apps when using cURL,
> SH>>     you have to worry not only which php version supports which
> SH>>     features, but also which curl version linked with php supports these
> SH>>     features, this is a real headache.
>
> No, quite the opposite - if the only thing you have to worry about would
> be installed cURL version and not PHP version (or if you could just write
> something like requires(curl >= 7.7.2) - just like RPM does, for example)
> - it would be easier. Especially taking into account that generally you
> hardly know which version of curl which PHP supported - how exactly many
> people know which constants were in with PHP 4.0.3/cURL without
> looking into the CVSweb? Probably less than two.
>

    This is not so...  If I write code that goes:

    if (phpversion == 4.0.8) {
        curl_setopt($ch, CURLOPT_SSL_VERIFYRESULT, 1);
    }

    I'd expect it to work with all php's above 4.0.8, the only problem
    is that if you link PHP 4.0.8 with an older version of CURL this
    will cause PHP compilation errors that maybe unforseen, therefore,
    to right it truly portable, you need two version checks for each new
    piece of code.

    if (phpversion == 4.0.8 && curl_version == 7.9) {
        curl_setopt($ch, CURLOPT_SSL_VERIFYRESULT, 1);
    }

    which makes writing portable code a real bitch...  This was a
    problem that many users were having when one version of php
    supported differed in support for a wide range of cURL constants
    from another.  Its much easier if configure barfs, this is an
    explicit error, and you only have to fix it once.

> That brings us to capabilities discovery and versioning discussion, which
> deserves its own topic and serious attention, outside this small issue I
> brought up. Maybe someone has to write an RFC for this.
>
> In any case, if you feel that it is absolutely necessary to support this
> constant in PHP, even though no cURL release still has it, please insert
> the relevant configure check. It is the real pain to go through three
> screens of gcc wailings each time and recompile it again just to discover
> yet another constant missing. (it would be also pretty much pain to have
> latest CVSes of 10+ packages just to be able to compile CVS PHP, but I
> talked about this already).
>

    cURL 7.9 was released today, I'll add a configure check.

    -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