Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117977 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25174 invoked from network); 17 Jun 2022 12:07:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 12:07:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 01F971804BD for ; Fri, 17 Jun 2022 06:55:45 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 06:55:44 -0700 (PDT) Received: by mail-pj1-f42.google.com with SMTP id hv24-20020a17090ae41800b001e33eebdb5dso7512488pjb.0 for ; Fri, 17 Jun 2022 06:55:44 -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; bh=btkV8Tp074Q19VJ2ut6pnQoD3dqJ+n3ComZmDCXtpmQ=; b=oWi2CF0xTtEJbMrVLKFFPMPzobpdCLP1NbiBNvprES29UKD7TD3dTwaZYho6UuwJrU YGRizk61rrvEHfupMLx5NvBRqu8bWdmNl03cIvWlriZgjG7yGj0CajfzoZvWSQXNMDhb 90LPZgC+ZGh5ItCRZ8OsP5Ovo6PCtTfS3bItSjGcIu0biLbypDDSe84+jIRXkh6y4Mf2 t/cbL1CUIxlCEmXVTMZEFFcXUzdzk4JkxgsJDVCzVkiMnYGpgQL6S6cuGKFEpdRwwu8W 28gkZuyqy7TZrm0aIkR7WdMMAu+aaCvDhiFsCMxG0pPnkfGoQ+nJcah20c0P7D4fAUpC HqjQ== 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; bh=btkV8Tp074Q19VJ2ut6pnQoD3dqJ+n3ComZmDCXtpmQ=; b=be5oqyA2RqdUx7yhsIaVxfzbCBUatLCAUejMvlm/Q4j9Wg97b8YIAGw+i+t9gNpEgQ xnjyEdZpYuWffISF3KXU7+DvmRb4LLmx8ydBbskF1gN8VtBBCelIADCYc2LCVevHrRP9 NzGNkEbi8FMjCrjqyfARgDqlrHdJFxhfpuTiPhU69p0lFRfRKEsthH9CiqOGBlD7KUMC wOApkHOgDjoDWaR30i0mcCOtY06qr+gB8Jr0Ng1W39v55vxEax3jUSo64aycsS7vk/u1 5qmLEDJFXu9ZSIda6GGAzY9tDXEC1crw3klqyyEZUaFsUNjD8bgTNyow9yL/h93ItHUk V9yg== X-Gm-Message-State: AJIora9tuWD3y1YKNOAncNHj9qsxpv0O8R+WSmKPgaLlaYIeeGJNPUwN XTAfKNxPsWm4pnZaWPOaSLXOhTkbHwKJmQs3U+mvRKzL1pU= X-Google-Smtp-Source: AGRyM1uiwA4wOytNRAIKxM3BeafDdR+NtzWrdEAZJ7hbFmmDajAoYbGeNPy1L7lIj4wbJapC7gqtWjTwPkeQ1ejQAkw= X-Received: by 2002:a17:902:d652:b0:168:bffe:e5fe with SMTP id y18-20020a170902d65200b00168bffee5femr10129879plh.81.1655474143640; Fri, 17 Jun 2022 06:55:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jun 2022 14:55:31 +0100 Message-ID: To: php internals Content-Type: multipart/alternative; boundary="00000000000044417e05e1a51cf1" Subject: Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements From: rowan.collins@gmail.com (Rowan Tommins) --00000000000044417e05e1a51cf1 Content-Type: text/plain; charset="UTF-8" Hi Pierrick, On Thu, 16 Jun 2022 at 22:44, Pierrick Charron wrote: > 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 agree with others that the new API should be exposed via a new, well-designed object, with no procedural version or low-level equivalence to libcurl. Something that nobody's brought up yet is that the curl extension actually already has a facility designed this way: CurlFile and CurlStringFile are high-level PHP objects which allow users to interact with file uploads, without any knowledge of what libcurl's API for them looks like. I think it's perfectly reasonable for CurlUrl to be designed the same way, regardless of what else we do with the extension. > We could also keep the existing API as is and not improve it living only > with the procedural API, but I think that with minimal effort, we could get > some small (but still) benefits. Yes, CurlHandle for example would just be > a wrapper on the procedural API that happens to use `->` and throw > exceptions instead of returning null/false, but one of the gains would be > to help developers with autocomplete to find methods they can call on the > handle. > This feels like a very small gain, since users can already type "curl_" and get a list of all curl functions. It also has real costs: users may be confused why there are two ways of writing the same thing; and it sets the precedent that methods on CurlHandle should mirror curl_* functions, even though we know those have terrible usability. I think if we do add methods to the CurlHandle class, they should be higher-level methods for common tasks that are currently unnecessarily awkward. I don't think we'd need to add everything at once, just establish some general design principles. (I'm honestly surprised that CURLOPT_RETURNTRANSFER, and curl_setopt in general, doesn't make it onto more lists of the worst parts of PHP.) Regards, -- Rowan Tommins [IMSoP] --00000000000044417e05e1a51cf1--