Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-21 Thread Eric Norris
On Mon, Jul 21, 2025 at 10:47 AM Eric Norris wrote: > > On Mon, Jul 7, 2025 at 12:53 PM Eric Norris wrote: > > > > On Wed, Jul 2, 2025 at 11:48 AM Eric Norris wrote: > > > > > > > Based on the feedback so far (I do plan on waiting for more responses > > > > to your email), and on my own preferen

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-21 Thread Eric Norris
On Mon, Jul 7, 2025 at 12:53 PM Eric Norris wrote: > > On Wed, Jul 2, 2025 at 11:48 AM Eric Norris wrote: > > > > > Based on the feedback so far (I do plan on waiting for more responses > > > to your email), and on my own preferences, I wonder if there is a > > > hybrid option I could propose. Pe

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-07 Thread Eric Norris
On Wed, Jul 2, 2025 at 11:48 AM Eric Norris wrote: > > > Based on the feedback so far (I do plan on waiting for more responses > > to your email), and on my own preferences, I wonder if there is a > > hybrid option I could propose. Perhaps the RFC could offer both a > > \Curl\Handle (tentative nam

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Paul M. Jones
Hi all, > On Jul 2, 2025, at 12:41, Larry Garfield wrote: > > On Wed, Jul 2, 2025, at 12:34 PM, Paul M. Jones wrote: >> Hi all, >> >>> The question of PHP-native request/response objects has come up a couple of >>> times, and even had an RFC that went to a vote (declined). My stance has >>>

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Larry Garfield
On Wed, Jul 2, 2025, at 12:34 PM, Paul M. Jones wrote: > Hi all, > >> The question of PHP-native request/response objects has come up a couple of >> times, and even had an RFC that went to a vote (declined). My stance has >> been, and remains, that ... they should be powerful enough to effective

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Paul M. Jones
Hi all, > The question of PHP-native request/response objects has come up a couple of > times, and even had an RFC that went to a vote (declined). My stance has > been, and remains, that ... they should be powerful enough to effectively > replace/displace PSR-7. Where and when have you previo

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Larry Garfield
On Wed, Jul 2, 2025, at 10:48 AM, Eric Norris wrote: > Having thought about this some more, while I'm still feeling somewhat > positive about my suggestion I'm just not sure it's the best way to > proceed. I started to sketch what a BasicHttpHandle class would look > like, and I'm stuck on how to

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Larry Garfield
On Wed, Jul 2, 2025, at 10:48 AM, Eric Norris wrote: >> Based on the feedback so far (I do plan on waiting for more responses >> to your email), and on my own preferences, I wonder if there is a >> hybrid option I could propose. Perhaps the RFC could offer both a >> \Curl\Handle (tentative name) to

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Ben Ramsey
> On Jul 2, 2025, at 10:48, Eric Norris wrote: > >> Based on the feedback so far (I do plan on waiting for more responses >> to your email), and on my own preferences, I wonder if there is a >> hybrid option I could propose. Perhaps the RFC could offer both a >> \Curl\Handle (tentative name) to a

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-07-02 Thread Eric Norris
> Based on the feedback so far (I do plan on waiting for more responses > to your email), and on my own preferences, I wonder if there is a > hybrid option I could propose. Perhaps the RFC could offer both a > \Curl\Handle (tentative name) to address position 1, and a > \Curl\BasicHttpHandle (also

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-30 Thread Eric Norris
Thanks for your thoughtful response, Larry! I agree with your summary. > 1. Status quo is fine. PHP core not having a user-friendly way to send HTTP > requests is acceptable. Maybe make Curl a little nicer, but only to make life > easier for Guzzle et al. > 2. We should develop the Curl API unti

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-30 Thread Eric Norris
> 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. Th

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-30 Thread Eric Norris
Thanks for your response Ayesh! I hope to see this RFC on php.watch :) > However, I softly oppose this RFC in its current state and the way it > seems to be going. > > I have pushed Curl and libcurl to some uncommon cases such as HTTP/3, > DoH, the new debug callback (which I authored the PR for),

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-30 Thread Eric Norris
> More specifically, since it does introduce an entirely new namespace it > should be considered a “new extension” and must therefore follow the > Exception policy outlined in: > https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#throwables Embarrassingly, I had read your RF

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-30 Thread Tim Düsterhus
Hi Am 2025-06-26 18:53, schrieb Larry Garfield: 2. Please don't name the exception "Exception". It needs some slightly more useful name, to avoid confusion in a file that also uses \Exception. More specifically, since it does introduce an entirely new namespace it should be considered a “ne

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-30 Thread Arvids Godjuks
On Sat, 28 Jun 2025 at 08:03, Larry Garfield wrote: > On Fri, Jun 27, 2025, at 4:58 PM, Ayesh Karunaratne wrote: > > > However, I softly oppose this RFC in its current state and the way it > > seems to be going. > > So I think we've identified a key disagreement about not just the goal, > but the

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-29 Thread Ben Ramsey
> On Jun 28, 2025, at 00:01, Larry Garfield wrote: > > On Fri, Jun 27, 2025, at 4:58 PM, Ayesh Karunaratne wrote: > >> However, I softly oppose this RFC in its current state and the way it >> seems to be going. > > So I think we've identified a key disagreement about not just the goal, but > t

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Larry Garfield
On Fri, Jun 27, 2025, at 4:58 PM, Ayesh Karunaratne wrote: > However, I softly oppose this RFC in its current state and the way it > seems to be going. So I think we've identified a key disagreement about not just the goal, but the intent. To what extent should PHP core ship with a usable HTTP

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Ayesh Karunaratne
> 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. > >

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Nicolas Grekas
Le sam. 28 juin 2025 à 00:01, Ayesh Karunaratne a écrit : > > Hello Internals, > > > > I'd like to formally propose a restart of the original object-oriented > > curl API RFC (https://wiki.php.net/rfc/curl-oop): > > > > https://wiki.php.net/rfc/curl_oop_v2 > > > > The prior RFC seemed to get posi

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Ayesh Karunaratne
> Hello Internals, > > I'd like to formally propose a restart of the original object-oriented > curl API RFC (https://wiki.php.net/rfc/curl-oop): > > https://wiki.php.net/rfc/curl_oop_v2 > > The prior RFC seemed to get positive feedback, with a small consensus > around wanting enum(s) for curl opti

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Paul M. Jones
Hi all, > On 26/06/2025 18:21, Eric Norris wrote: >> I know that in the prior discussion, Rowan Tommins had a vision for a >> high-level API (https://externals.io/message/122371#122424) > > > I think calling it a "vision for a high-level API" is making it sound far > more grandiose than what I

RE: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Juris Evertovskis
-Original Message- From: Eric Norris Sent: Thursday, June 26, 2025 7:25 PM To: PHP internals Subject: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 > I'd like to formally propose a restart of the original object-oriented curl > API RFC Cool. Calling functions

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Rowan Tommins [IMSoP]
On 27/06/2025 04:51, Eric Norris wrote: I can try to take a look at the curl options and do some github searches to see if I can identify common patterns. I agree that setting the HTTP method and timeout are good contenders. If someone else wants to propose a list as well, feel free! For what

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Ben Ramsey
On 6/27/25 08:01, Deleu wrote: With that said, for me this also threads into the bikeshedding area that could spiral into a failed RFC. Be it a single Enum for everything, constants, context-based enums or type-based enums, I would much rather have this RFC than not have it. PHP is one of the

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Larry Garfield
On Thu, Jun 26, 2025, at 10:51 PM, Eric Norris wrote: >> Adding more helpers in later versions is entirely trivial, but we could >> set the precedent with a first batch on day one. > > I'm not opposed to this, but I am - as previously stated - nervous > about how and where we draw this line, since

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Larry Garfield
On Fri, Jun 27, 2025, at 8:01 AM, Deleu wrote: > On Fri, Jun 27, 2025 at 9:24 AM Jordi Boggiano wrote: >> On 26.06.2025 18:25, Eric Norris wrote: >> > - uses enumerations for curl options and other curl constants >> >> Overall I think the RFC is a good opportunity to clean up a few legacy >> odd

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Deleu
On Fri, Jun 27, 2025 at 9:24 AM Jordi Boggiano wrote: > On 26.06.2025 18:25, Eric Norris wrote: > > - uses enumerations for curl options and other curl constants > > Overall I think the RFC is a good opportunity to clean up a few legacy > oddities in the curl API, but I need to throw in my 2c abo

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-27 Thread Jordi Boggiano
On 26.06.2025 18:25, Eric Norris wrote: - uses enumerations for curl options and other curl constants Overall I think the RFC is a good opportunity to clean up a few legacy oddities in the curl API, but I need to throw in my 2c about enum usage here, as someone that has actually implemented s

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Eric Norris
Thanks Rowan! > I think calling it a "vision for a high-level API" is making it sound > far more grandiose than what I suggested. What I suggested, and would > still like to see, is a small number of additional methods, for setting > really common options in a more user-friendly way. I apologize

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Marco Aurélio Deleu
> > On 26 Jun 2025, at 18:07, Rowan Tommins [IMSoP] wrote: > > On 26/06/2025 17:53, Larry Garfield wrote: > >> Now here's the big one: Using enums rather than a bunch of constants is a >> good change. However, I feel like it doesn't go far enough. > > > 100% this. > > Writing "$ch->setO

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Rowan Tommins [IMSoP]
On 26/06/2025 17:53, Larry Garfield wrote: Now here's the big one: Using enums rather than a bunch of constants is a good change. However, I feel like it doesn't go far enough. 100% this. Writing "$ch->setOptionInt(Curl\Option\IntOpt::ConnectTimeout, 30);" instead of "curl_setopt(CURLOPT_

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Thomas Bley
> Ben Ramsey hat am 26.06.2025 18:54 CEST geschrieben: > > > On Thu, Jun 26, 2025 at 11:27 Eric Norris mailto:eric.t.nor...@gmail.com> wrote: > > > Hello Internals, > > > > I'd like to formally propose a restart of the original object-oriented > > curl API RFC (https://wiki.php.net/rfc/c

[PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Eric Norris
Hello Internals, I'd like to formally propose a restart of the original object-oriented curl API RFC (https://wiki.php.net/rfc/curl-oop): https://wiki.php.net/rfc/curl_oop_v2 The prior RFC seemed to get positive feedback, with a small consensus around wanting enum(s) for curl options. I've taken

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Eric Norris
Thanks Larry! > 1. I don't think the Curl\Option namespace is necessary. They can just be in > the main Curl namespace. I don't feel strongly here, but I thought it would be nice to group the enums (if we go the multiple enum route) for discoverability. Thoughts? > 2. Please don't name the exc

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Eric Norris
> IMO, this sounds like something that would be great to start as a userland > OOP wrapper for cURL, where it can be iterated on and the interface can be > tested and changed much quicker. Then, maybe proceed to an external extension > that can be migrated into core later, once its interface is

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Larry Garfield
On Thu, Jun 26, 2025, at 11:25 AM, Eric Norris wrote: > Hello Internals, > > I'd like to formally propose a restart of the original object-oriented > curl API RFC (https://wiki.php.net/rfc/curl-oop): > > https://wiki.php.net/rfc/curl_oop_v2 > > The prior RFC seemed to get positive feedback, with a

Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2

2025-06-26 Thread Ben Ramsey
On Thu, Jun 26, 2025 at 11:27 Eric Norris wrote: > Hello Internals, > > I'd like to formally propose a restart of the original object-oriented > curl API RFC (https://wiki.php.net/rfc/curl-oop): > > https://wiki.php.net/rfc/curl_oop_v2 > > The prior RFC seemed to get positive feedback, with a sma