Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117972 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 95599 invoked from network); 17 Jun 2022 06:39:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 06:39:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CCB56180384 for ; Fri, 17 Jun 2022 01:27:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 17 Jun 2022 01:27:40 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id 19so3836835iou.12 for ; Fri, 17 Jun 2022 01:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P2v+LshkgY3HwkpilhSjRIhfDQ2pCNdt430ZUZP8Z2w=; b=I1E1xDCw2dLVLUi2BOyew4crZHZR68dskuIxjPJZX8R557cLKu/ClELar5KZnFBL7a voAGMHdYc2RQVpxL7nAF0QIaOuZYa/9Hp8tXzfPaKS44xYQ+U/0iZFGpYDOIuHlya856 eCEZ+US84nN8MV2JWdHT8iUDZgS7WQLcLRx8z80e9QON2Eml7HxlWUc8CNsuP0pP840O LVxhnAc2hvPUejydEwVDSE3DHglhSZejNHeC07aMqkOIQB/t6ebzNTzUr7TVg7rp6iQn 5FXqcur0mUp83tFscwhpHaehPghbeMVhYnemHYgF4XxqgVI47UK1Sw8fmTblo1jB4OP8 otKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P2v+LshkgY3HwkpilhSjRIhfDQ2pCNdt430ZUZP8Z2w=; b=EXQbtewSw79ASC4R59SKD8sUrJL89Wxl0lGGSKBTTThwq2S79G9UWM1VyvqVxS/keu PWqjjhsRPiCU18Llzfk6ayGWxttMGmofGDgmYUpjnofp5ZAj4VFerpT05VEE/jeYxEhR BJT7LkOQW9Jf3NtQwZGiiLeD+l2r0ol/Yavm7MTMZ9qxDUzQP4VTsrc5Xc1FLkHMDzuc ZfV9kYxodrZakCjp6YcxzIjdbxrgo2fTx/Irn7kQl7Hv+T57OHL+2SRCG7/HZFP4GFEN HRQ+oDUZ66AE/tY0talNfTOVLYDY9fnNi0AoJsNsqiOTLX8XOrD+39x/0oTCgnZjrkeL WwMQ== X-Gm-Message-State: AJIora/WuXQ+xCzXmqtgKCuZ7dthCWcX78D8NPJpoWsRQ9cEXiQYVNk6 Kt0IUfg45pePYy8nVciRZmukAFzdqq8z/oYYSlqTTJgg/iI= X-Google-Smtp-Source: AGRyM1up8uJnZq92zQ9DAm/373ybWZzr3lfc6W6ALEyGjt1Wwmz+RDU90YExwT97EkyHH7tWgnUc3j8PTDzkOSWu82k= X-Received: by 2002:a02:8543:0:b0:331:6142:d305 with SMTP id g61-20020a028543000000b003316142d305mr5065188jai.318.1655454459489; Fri, 17 Jun 2022 01:27:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jun 2022 10:27:12 +0200 Message-ID: To: Pierrick Charron Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000fff1e905e1a086a5" Subject: Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements From: kjarli@gmail.com (Lynn) --000000000000fff1e905e1a086a5 Content-Type: text/plain; charset="UTF-8" Good timezone! On Thu, Jun 16, 2022 at 11:44 PM Pierrick Charron wrote: > About making a "Good OOP API", of course the goal is to make a *Good* OOP > API. But there are things to take into consideration. The proposal here is > yes to expose the new Curl URL API which is quite small, but also to modify > the existing curl API to make it a little bit more digest for developers. > Good or bad the existing ext/curl is here and will continue to exist for > quite some time. It was designed (maybe on purpose or not) to be a low > level API with tons [1] of low level features, and it was clearly designed > as a thin wrapper/bridge over libcurl. I mean the fact is currently each > constant is the exact same one as in libcurl, and each function is a > wrapper over the exact same function in libcurl. Is it OK to have one part > that is a thin wrapper and another part that is a "remodeling" of the API ? > (This is not a rhetorical question, I really ask myself the question). > I'm not a C developer, and the only other place I've ever used cURL is on the command line. I honestly care very little for it resembling whatever the C library is, as C is a different language with no OOP. The procedural API for cURL is really annoying to deal with, and I think it would be worth designing an OOP counterpart. I think most of this would go into a new design for setting options among things, as a list of constants with possible values is one of the worst ways to have to configure something in my opinion. I know that both the Symfony Http Client and Guzzle are popular libraries, perhaps design wise they could serve as an inspiration? I'm personally not too experienced with cURL nor the level of details that go into http libraries, but I do see this as an opportunity to make a really good implementation from scratch. In my opinion it's worth spending some time on this. Larry said: Like most of the responders so far, I would say skip the procedural API, > just go OOP and be done with it. > I'm okay implementing one last feature in the procedural API if it's really desired to have this functionality, especially if this is beneficial for security and reduces bugs. The reason being is that even if we have the best possible OOP library for cURL, every single procedural API would benefit from this change without having to completely rewrite their implementation, which will be a problem if the OOP interface isn't just a 1:1 copy into object form. That said, we should avoid having: cURL procedural + cURL procedural in objects + cURL OOP. Having 2 different object based libraries to do the same thing PHP is confusing and will just end up in way too many Stack Overflow questions. Perhaps it is best to split this into 2 separate RFCs? Regards, Lynn --000000000000fff1e905e1a086a5--