Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117984 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46091 invoked from network); 17 Jun 2022 14:26:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 14:26:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2A98F180550 for ; Fri, 17 Jun 2022 09:14:17 -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=1.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL,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-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (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 09:14:16 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id 23so8038468ybe.8 for ; Fri, 17 Jun 2022 09:14:16 -0700 (PDT) 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=JpDmkL7/I2JorzsxfjHwnHmJfskxqLSmz9/8U6FpAHA=; b=4y2i+/UF9W41wkLZ9/pJrvcfRT1qxcMr+nD8fDGEP96iMQN0mz9VDWSr5Ve3y5QOO7 tpFQby+Zi3HNFpGdvinq3vxlnwZq1dh16q+Oep5f72SlhNPW7dl7UL3GL6R0jf05/e1Z gmJgJ84dWw3v163ek6bTmHoiYZ2SEv0qXk3Bhy5BsaMiGYA6CuGX+uxCtrJOM9tHNg0a gBW2VmAWEYyBumt8oMWHET5EZ4183Tg9cf/d4FhiOEcKrYG39grQZbP29sg7L7EIQu00 l3OYHQJ+5A14FV4oUwaV1qdI9k1FDriLykjNizA8dbtL7YNpqVRIo4Rq3+UYwNdF3onx 6YDg== X-Gm-Message-State: AJIora8X//febAeGlcb3tM+Kt5Sn3GbHBR5C/v8iHGx6yQD1iwjvjepa XnGCBaVJ4RPogsRy0UHpITCXqYeZ7K7CWbiQbSPNhJmfn2Bq8w== X-Google-Smtp-Source: AGRyM1uXwPSwayAdydJbUeX7BoFrWOxerkNlTczTOxNk9xkkx2eQmjZmhNoExNbJ4eccxZF7aaTNjiT9+OIPHUoDJcc= X-Received: by 2002:a25:a4c7:0:b0:664:d73e:67e7 with SMTP id g65-20020a25a4c7000000b00664d73e67e7mr11783452ybi.299.1655482456348; Fri, 17 Jun 2022 09:14:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jun 2022 11:14:05 -0500 Message-ID: To: Pierrick Charron Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000be32ba05e1a70bd8" Subject: Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements From: pollita@php.net (Sara Golemon) --000000000000be32ba05e1a70bd8 Content-Type: text/plain; charset="UTF-8" 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 --000000000000be32ba05e1a70bd8--