Re: [RFC][DISCUSSION] Object-oriented curl API v2
| From: | Ayesh Karunaratne | Date: | Fri, 27 Jun 2025 22:25:15 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Object-oriented curl API v2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127779@lists.php.net to get a copy of this message | ||
> I'm not even sure it's a good idea to add those namespaced options: using
> CURLOPT_SSL_VERIFYHOST is perfect to find the corresponding curl documentation with your favorite
> search engine. php's doc is awesome, but it cannot compete with the details provided by
> curl's doc on the topic.
>
> Nicolas
Hi Nicolas,
You are right, if we were to rename those constants, we would lose the
"grep-ability" in both libcurl source/docs and many years of existing
open source projects and discussions.
So while keeping the existing option consts, info consts, we do not
have a lot of room to improve it. Perhaps the
CurlHandle objects can
accept options similar to how we have date_* functions alongside
DateTime methods. I personally continue to use the functions, but I
won't mind having an OOP API. We can leave it to the library authors
(such as you, Nicolas 💟, Symfony HTTP client is just awesome) to
design more intuitive APIs.
Ayesh.