Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117998 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85494 invoked from network); 17 Jun 2022 19:12:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 19:12:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4E5A7180538 for ; Fri, 17 Jun 2022 14:00:57 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (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 14:00:56 -0700 (PDT) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-1016409cf0bso6933651fac.12 for ; Fri, 17 Jun 2022 14:00:56 -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=hYLZPUlkfwy9OVYJVjGDU3IszLJdoqmxB441iC5dHE0=; b=dPlSGxdIJ+p6xkkTROgpR8+FjpMuy0+KMxd2b/0JqAvbT+TYofHJ9W+JicUU4dfvdk REl/UgXfPs1TSV7tmYWQt2y3jo0PgFeSB0Bys7QKWE6g5dZFeuLGKN+xwkkPdHGDSTh5 E92zhik/QGwPoNYhqKznSzKGTfvrHu5Bqx/VskSDed6Nig7Dsgs6n5d3J2ZUh4MPgaED fRAQxbxuLT6VP6vZljLcLT83FfNPz/rmv5KNSu+7LQYCxvtX/TnzUyvUlUbVuIUj3Fvn 5z8Ymif6bF5UL8YHcLGkJ/A3exiqsc9ZpUIrs2yykTx+ZDYtIppcrs73A9lrerQTf7T1 ZM8g== 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=hYLZPUlkfwy9OVYJVjGDU3IszLJdoqmxB441iC5dHE0=; b=obhyc+6jRGIULPigccyAy2WAdYl0KodwrUnZoQNed2txdOJAjp52B7Z0ud0D2yNTJe m9ynAYmBRKt4wkNkxydsSsUSH++9lsS0fF0G1ihufT2aLq8vcElTqWhOaZs7vae8V0u+ xrP6anKRPHOS6t2bmRcm1nVW9wxQL+ovQn/Pjsgh6WUsdDTnLw4xFlbphlUBvmmw4fQP S+hiBjyXjz/JLW122qnENx6BrF50T0YZX1sEtbPG1fDvMNhAYYqEccsMlQFUEpWXUCoY 1NQjJZ3voIyhHJMYqvQ5vLuzHLDKBRwYJ/Rh28A0WmtnmOMatxUGHiXVjgcFPpoG6LoU GQkg== X-Gm-Message-State: AJIora8F671d6vEZDiQnee3ZJRfvKQD4Wo240DZXCnYZR/RKTFZrZd27 RaEeR3SvC3QC+a7zjx4nNhtY/Pkt7GCjCEwiGvajbqAfWkk= X-Google-Smtp-Source: AGRyM1sRSM+pvCCfdsvQkBpBdzCGo3aEHnmsb2VvBTSbF67azoPtMfuus5yRGhDaseOgcAs1/VVkw4ksoosQkjRuZC0= X-Received: by 2002:a05:6870:c38e:b0:ed:f230:1494 with SMTP id g14-20020a056870c38e00b000edf2301494mr12203700oao.36.1655499656105; Fri, 17 Jun 2022 14:00:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jun 2022 23:00:43 +0200 Message-ID: To: Sara Golemon Cc: Pierrick Charron , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements From: landers.robert@gmail.com (Robert Landers) On Fri, Jun 17, 2022 at 6:14 PM Sara Golemon wrote: > > On Thu, Jun 16, 2022 at 2:10 AM Pierrick Charron wrote: > > > For a long time, ext/curl worked with handles as "curl resources" and > > functions mapped to the libcurl functions, but since PHP8.0 "curl > > resources" were converted to opaque classes with no methods. So my main > > goal here is to come up with a solution for the new Curl URL API, but maybe > > also to be consistent, make some changes to existing curl classes like > > `CurlHandle` to add methods and improve the current state of the extension. > > > > > This is so bizarre, I *know* I wrote an OOPified cURL extension some years > ago (called it curli), and now I can't find it anywhere. What universe am > I even in? > > Anyway, +1 on making a whole new OOPified cURL implementation. $ch = > (new CurlHandle($uri))->setOpt(Curl::OPT_METHOD, 'post')->perform(); > Let it throw exceptions, do proper type checks, all the goodness. Let the > procedural APIs behave differently than the object methods and that's okay. > > cURL is a foundational extension in PHP and I respect the choices that were > made in its API design, but it's 2022, and we deserve a better ext/curl. > > -Sara Also, would it be unreasonable to ask it to take advantage of the Fiber constructs if in a Fiber context? That would be simply amazing if this high-level OOP implementation were async-ish by default. If anything should get native Fiber superpowers, it should be this extension, IMHO. Also, IMHO, this is an unreasonable request, but perhaps a separate RFC once this original proposal is accepted and figured out?