Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-18 Thread Rowan Tommins
On 18 February 2024 15:26:37 GMT, Lynn wrote: > Having a lot of setters for options might make it really hard to find the >methods you're looking for in terms of auto-complete in your IDE. I think it would be significantly better for that purpose than what we have now, because there would be a

Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-18 Thread Lynn
On Sun, Feb 18, 2024 at 12:41 PM Rowan Tommins wrote: > On 17 February 2024 15:57:20 GMT, Larry Garfield > wrote: > > >The RFC would also benefit greatly from some practical examples of using > the new API. Right now it's not clear to me (as someone who almost never > uses Curl directly) how/wh

Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-18 Thread Rowan Tommins
On 17 February 2024 15:57:20 GMT, Larry Garfield wrote: >The RFC would also benefit greatly from some practical examples of using the >new API. Right now it's not clear to me (as someone who almost never uses >Curl directly) how/why I'd use any of these, since there's still "a whole >crapton

Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-17 Thread Larry Garfield
On Thu, Feb 15, 2024, at 9:44 AM, Sara Golemon wrote: > Summarizing replies so far. Won't be able to update the RFC > immediately as my day job needs me, but some great discussions already, > gang. Thanks! > > * Define the conditions under which exceptions will be thrown (and > which exceptions

Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-17 Thread Gina P. Banyard
On Saturday, 17 February 2024 at 07:41, Kalle Sommer Nielsen wrote: > Hi Sara > > Den tors. 15. feb. 2024 kl. 21.08 skrev Sara Golemon poll...@php.net: > > > * Better typing for setOpt() methods. > > Comment: Yep, this is a good and fair point. It's going to take a little > > more dicing up o

Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-17 Thread Kalle Sommer Nielsen
Hi Sara Den tors. 15. feb. 2024 kl. 21.08 skrev Sara Golemon : > * Better typing for setOpt() methods. > Comment: Yep, this is a good and fair point. It's going to take a little > more dicing up of the current implementation, but hopefully not too rough. > Proposal: Keep untyped setOption()

[PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-17 Thread Rowan Tommins
On 16 February 2024 16:09:32 GMT, Rowan Tommins wrote: >public function executeAndReturn(): string >public function executeAndOutput(): void I guess I missed: public function executeToFile(Stream $fileHandle): void public function executeWithCallback(callable $wrIteFunction): void which would

[PHP-DEV] R: [RFC] OOP API for cURL extension

2024-02-17 Thread ssil...@libero.it
Hi Sara, i like this proposal. Silvio From: Sara Golemon Sent: Wednesday, February 14, 2024 7:47 PM To: PHP internals Subject: [RFC] OOP API for cURL extension Good afternoon folks, I'd like to open discussion on adding OOP APIs to the cURL extension.

[PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-17 Thread Rowan Tommins
On 15 February 2024 15:44:13 GMT, Sara Golemon wrote: >* CurlHandle::exec() mixed typing of return values. > Comment: Agreed. The `true` return value becomes meaningless in the >RETURNTRANSFER==false case. > Proposal: Update the RFC for CurlHandle::execute() to return ?string. Should we take t

Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-16 Thread Tim Düsterhus
Hi On 2/15/24 16:44, Sara Golemon wrote: * Define the conditions under which exceptions will be thrown (and which exceptions) - I'll add these to the RFC, but in short: * CurlException - Never, it's an interface type to group the other exceptions. Interface or base Exception? I would sugges

[PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-16 Thread Yousuf Tafhim
+1 from me too On Thu, Feb 15, 2024 at 5:30 PM Flávio Heleno wrote: > On Wed, Feb 14, 2024 at 10:44 PM Sara Golemon wrote: > >> Good afternoon folks, I'd like to open discussion on adding OOP APIs to >> the cURL extension. >> https://wiki.php.net/rfc/curl-oop >> >> This has been a long standing

[PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Sara Golemon
Summarizing replies so far. Won't be able to update the RFC immediately as my day job needs me, but some great discussions already, gang. Thanks! * Define the conditions under which exceptions will be thrown (and which exceptions) - I'll add these to the RFC, but in short: * CurlException - Nev

[PHP-DEV] Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Dik Takken
On 14-02-2024 19:47, Sara Golemon wrote: Good afternoon folks, I'd like to open discussion on adding OOP APIs to the cURL extension. https://wiki.php.net/rfc/curl-oop This has been a long standing bug-bear of mine, and I think its time has come. try { (new \CurlHandle)->setOpt(YOUR_VOTE, tru

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Flávio Heleno
On Wed, Feb 14, 2024 at 10:44 PM Sara Golemon wrote: > Good afternoon folks, I'd like to open discussion on adding OOP APIs to > the cURL extension. > https://wiki.php.net/rfc/curl-oop > > This has been a long standing bug-bear of mine, and I think its time has > come. > > try { > (new \CurlHan

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Григорий Senior PHP / Разработчик Web
Working with remote servers is a little bit harder than just catching the exception. Just implement OOP stuff gives no benefit except "do not read the docs, but use IDE". Usually count of curl options is so big that it wont help. And also, there's multicurl too. There's batch calling with limit t

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Christian Stoller
Am 15-Feb-2024 03:30:44 +0100 schrieb poll...@php.net: > Good afternoon folks, I'd like to open discussion on adding OOP APIs to the > cURL extension. > https://wiki.php.net/rfc/curl-oop > > This has been a long standing bug-bear of mine, and I think its time has come. > > try { >   (new \CurlHa

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Tim Starling
On 15/2/24 05:47, Sara Golemon wrote: Good afternoon folks, I'd like to open discussion on adding OOP APIs to the cURL extension. https://wiki.php.net/rfc/curl-oop Thanks for making this. It's certainly an improvement, but it's disappointing to see such a conservative change when the extension

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Thomas Bley
> Sara Golemon hat am 14.02.2024 19:47 CET geschrieben: > > > Good afternoon folks, I'd like to open discussion on adding OOP APIs to the > cURL extension. > https://wiki.php.net/rfc/curl-oop > > This has been a long standing bug-bear of mine, and I think its time has come. > > try { > (new \Curl

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Kamil Tekiela
I love it! When is CurlMultiException and CurlShareException thrown? I feel like this part in general is not very clear in the RFC.

Re: [RFC] OOP API for cURL extension

2024-02-15 Thread Arvids Godjuks
On Thu, 15 Feb 2024 at 03:53, Sara Golemon wrote: > Good afternoon folks, I'd like to open discussion on adding OOP APIs to > the cURL extension. > https://wiki.php.net/rfc/curl-oop > > This has been a long standing bug-bear of mine, and I think its time has > come. > > try { > (new \CurlHandle

[RFC] OOP API for cURL extension

2024-02-14 Thread Sara Golemon
Good afternoon folks, I'd like to open discussion on adding OOP APIs to the cURL extension. https://wiki.php.net/rfc/curl-oop This has been a long standing bug-bear of mine, and I think its time has come. try { (new \CurlHandle)->setOpt(YOUR_VOTE, true)->exec(); } catch (\CurlHandleException $e