Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127760 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id B09C61A00CB for ; Thu, 26 Jun 2025 16:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750956781; bh=EMowzwJf/XJbiSpukzapU58yyg2Os8u9SfaEPjy0ggw=; h=References:In-Reply-To:From:Date:Subject:To:From; b=UfOU1/GfiwUeb6qWYYbMgjOyL+me+/acrXyP+Y1TpaiJhgJoQJlt6hvoCq8W4bZiS 8b1ZqXyOFBSNky53+W8PwyWgGHHbDfxcalNUjkIA08DykAffvFX/XWrWPIva2qstIf MljTZgNzysFy55nZkZ30N3OY4bqRLTTnjv4bdR0wGGnJJfmKlNh20cTd02grK+v7+t Y7zOqRL8R/AZKXS3pCaZ8Uyuj2/5BVo569MRSPeo2UKVKmKvvWrlzXnIh+L+ZmqtCf wU/+HLHzmST6P/cR2nIbwj44TmXx3HS8+eVwY3Vjkngk20/0h1HjARz5T1sUoiAY/U 5PSzIJOoXH3LA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF18A180088 for ; Thu, 26 Jun 2025 16:52:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_50,DMARC_NONE, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 26 Jun 2025 16:52:59 +0000 (UTC) Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-e8600c87293so944049276.1 for ; Thu, 26 Jun 2025 09:54:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750956894; x=1751561694; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EMowzwJf/XJbiSpukzapU58yyg2Os8u9SfaEPjy0ggw=; b=c/hegiKXXF1HsqVEh3AyubOPWsDgN0Ak7ZneslYtM+hgfQnRs3qn8KpaLMThd+C905 uXS6traZg2KSj63voYS+v8nlluh3hPNnRFWjFnLkNZCde4DuCicZ5KjrGXvY29CJ+zhy P/19EnI6RncYDLSyfu/SwpnUTvZnkWq7JtoFSetxOe3A0HHJ7lgSP30R121XDMRMC2J0 d8rw23T4lJHC54TXuqCsxKHwrI0+y0DT58hoY9yzJ6a8b2/SJ71onOBhBrtVNW2apz2o JRwqya0Cm7HUsk/6UiPMEvFeaItzSTeQzEIVh+FcOak9PXl8zz70+o3lkAok1x9nmtX1 eQ7Q== X-Gm-Message-State: AOJu0YwKI9iCIyhkXYHY2xmAyzrHWrLEcMD4EmToA62ltlvAZBULsROd EY7MZcxYHkNp1AZFZZDIMq8lVKeyWnA6JLXZM18WmlBF9rvDHNOBnz8JFJoOTv6sRtQHKBvcFrJ PCKQ= X-Gm-Gg: ASbGncuhj+hj16WUrJFvFTPf13oysgujs0VLizpCbqi/LwuuectXuKrjEB4o+TUWxtv 9JuyPxl6XAIw2RjRZhRHEExjTwFgUYSyM/PBxFYXStxzSUzzicPYB+qFuGcroVzITb3k9c0zmi2 BmN4xx1g3DRrLfTkDBWaAHX8t3+uyp7HFf3ALdLG6z1RfSHM7BF/Y1HWu+Gdc5NAN4fI70lG4Da 8NCtcZ7at78e5GdfGQdg6rmT0jYBC660pMdbLZnQOVTfCul1a7+nbV5DZ/ia9MCjs/YNuGfOdCd ZfexKKJZqAkQQ+4MqUrLnr5FZq9JXx9yo/rWaqVl6mTOkguQK9LO0V0h7N/9WIXt5Tn1c2oMRr/ 2np73F+oR1MUPpxmQDEgh X-Google-Smtp-Source: AGHT+IGz8iiAKdOejGkxjc2vhrD892rcEZlP60aokivCToqAGhabMgiAj1oePfDWE3WsOkJOKi60GA== X-Received: by 2002:a05:6902:2005:b0:e81:9e35:c60c with SMTP id 3f1490d57ef6-e87a7b02376mr108994276.8.1750956893625; Thu, 26 Jun 2025 09:54:53 -0700 (PDT) Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com. [209.85.128.171]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e87a6b64349sm96746276.16.2025.06.26.09.54.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Jun 2025 09:54:53 -0700 (PDT) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-711d4689084so14557197b3.0 for ; Thu, 26 Jun 2025 09:54:52 -0700 (PDT) X-Received: by 2002:a05:690c:6c8b:b0:70d:ed5d:b4da with SMTP id 00721157ae682-71515f9aa1bmr8856407b3.8.1750956892714; Thu, 26 Jun 2025 09:54:52 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 26 Jun 2025 11:54:42 -0500 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXwV2bIWcAuKEvb3jjHWnusPVyG4Ng8y2zsZdBPWXqmzRrIlAzL9cGIeHD0 Message-ID: Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 To: PHP Development Content-Type: multipart/alternative; boundary="0000000000009b8af306387c6b12" From: ramsey@php.net (Ben Ramsey) --0000000000009b8af306387c6b12 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 small consensus > around wanting enum(s) for curl options. I've taken that feedback and > incorporated it into a new RFC, as I am not the original author, but I > am interested in making another potential improvement to the curl > extension. > > In a nutshell, this version of the RFC: > > - uses enumerations for curl options and other curl constants > - introduces a new Curl namespace > > I have not yet created an implementation PR. I realize that is > somewhat discouraged, but I believe that this should be relatively > straightforward to implement (there's also the previous RFC's PR to > build on top of). The implementation of this RFC as it is now will > likely be tedious, however, so I'd like to get feedback on the > enumeration idea before committing to the work. > > I've outlined one open question in the RFC, which relates to the above: > > - Should we organize the curl option enumerations by value type? Or > have a single enumeration for all curl_setopt options and another for > all curl_multi_setopt options? > > If others (including the original RFC author) are interested in > working with me on this, I'm more than open to that, so please let me > know. > > Thanks, > Eric 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 stable. cURL is massive, and there are a lot of moving parts. I wouldn=E2=80=99t ex= pect to get the API correct on the first try. :-) Cheers, Ben --0000000000009b8af306387c6b12 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jun 26, 2025 at 11:27 Eric Norris <eric.t.norris@gmail.com> wrote:
Hello Intern= als,

I'd like to formally propose a restart of the original object-oriented<= br> 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 that feedback and incorporated it into a new RFC, as I am not the original author, but I
am interested in making another potential improvement to the curl
extension.

In a nutshell, this version of the RFC:

- uses enumerations for curl options and other curl constants
- introduces a new Curl namespace

I have not yet created an implementation PR. I realize that is
somewhat discouraged, but I believe that this should be relatively
straightforward to implement (there's also the previous RFC's PR to=
build on top of). The implementation of this RFC as it is now will
likely be tedious, however, so I'd like to get feedback on the
enumeration idea before committing to the work.

I've outlined one open question in the RFC, which relates to the above:=

- Should we organize the curl option enumerations by value type? Or
have a single enumeration for all curl_setopt options and another for
all curl_multi_setopt options?

If others (including the original RFC author) are interested in
working with me on this, I'm more than open to that, so please let me know.

Thanks,
Eric


IMO, this sounds like something that would be great to star= t as a userland OOP wrapper for cURL, where it can be iterated on and the i= nterface 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 stable.

cURL is mass= ive, and there are a lot of moving parts. I wouldn=E2=80=99t expect to get = the API correct on the first try. :-)=C2=A0

Cheers,
Ben

--0000000000009b8af306387c6b12--