Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118108 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7021 invoked from network); 27 Jun 2022 14:00:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2022 14:00:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 20BF41804BD for ; Mon, 27 Jun 2022 08:50:58 -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,NICE_REPLY_A, 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-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 ; Mon, 27 Jun 2022 08:50:57 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id k22so13679988wrd.6 for ; Mon, 27 Jun 2022 08:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=norPuRdhzC2QR2WvP4dTOS5PkrVxi8AxHbpdb0Pq31c=; b=NlVVwyLQAI/ghhcL7r29vwyrxtRK6upqXFgangwaS9WvCG26sZRS6TzCGBMOwyrNZX ijSjddvIzC+K7j5+a9Gh07ZaBp275z0ong0iaAaXNAF470DKmdTDOZqLe1qVduEvYVjz VqiTKfoJZtqPBF5oack2jqJfzws8EXnhv4bXVeaKXltf83R/lEEjWM2x5ScsvoDYiGlJ bmXH8euFqJ3FfMnIxBdRULq70FSrd3P6NvFkJz1noFllQDJcsVPR9TIz0GvwlnAt0mm9 U3UAHiIhZBC4/EWSbf7o9TnDxs5TXJzooGNP1X4pvejptgfn+AM8ZnEE8jXmhqJQJ+X2 VHjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=norPuRdhzC2QR2WvP4dTOS5PkrVxi8AxHbpdb0Pq31c=; b=Kbr2BIcmLSnGkzJnvW0rf3A3Qla98lpf7YQlLqijBoYCrOhyt4pzjCHaKoqw7NWPQS /s2h2DVUfGhbvUkQJCWShVq326z6L45936rIzLYOfagdOBNL0PJ5oDGeLBNiDiQzgfXe KfTZZ7VC07vJABJ8KT/GdeYsv1ReN0PjtDegD19cHRhK3Ua/T07bzyaixFEC/e6AdCWQ NkiGYNwRyKMvU+lscZo1hbnsuicYUf28i9D0cI9+cpBWKaj+RYNWdZcJxo75m03YO4eZ tPcgCFcVYg+8ouk6caVvIBoKeWtcdV9BiMlOzXy+3WrgWvhJzfLgN+IOa6yIFM3/K4At hWmQ== X-Gm-Message-State: AJIora8AB6mYxvWr2aqfvV4N3GHVinp3KEgcslB8rGGhhkXWJm9yVJjt eEJ1EXEehgx9wrFgXozhqDMWlZAAqP4= X-Google-Smtp-Source: AGRyM1v6jkH/kSGCmLYcD81IIHOGvMH4u5xxKGBx8rMWfQ3ELedu8PJkAAMmTzFyReCq5NPfjbGUWQ== X-Received: by 2002:adf:d1c4:0:b0:21b:90c3:9cec with SMTP id b4-20020adfd1c4000000b0021b90c39cecmr13216857wrd.471.1656345056451; Mon, 27 Jun 2022 08:50:56 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id v17-20020a5d43d1000000b0021b95bcaf7fsm10734849wrr.59.2022.06.27.08.50.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 08:50:55 -0700 (PDT) Message-ID: <4511aee0-b5a0-6310-270f-38ae5cfd8a06@gmail.com> Date: Mon, 27 Jun 2022 16:50:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-GB To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API From: rowan.collins@gmail.com (Rowan Tommins) On 27/06/2022 14:10, Pierrick Charron wrote: > The purpose of the CurlUrl class is to be able to build/see/modify an URL > as it is seen by libcurl before/after passing it to your CurlHandle. It is > not meant to be used alone as a representation of an URL. > > For example, you may want to do some checks to make sure that the URL you > gave to your CurlHandle is well formatted and that the host or any other > parts are what you want them to be, and that it was not something else > because of some differences on how the URL was parsed. Or you may want to > add/delete/overwrite some parts to sanitize your URL. That's why you have > those setters/getters. This class is definitively not there to replace > PSR-7 UriInterface. I can imagine some Guzzle or other implementation to > build a CurlUrl handle from a UriInterface before giving it to curl. This leaves me a bit baffled, frankly. If I've got a URL, which is already a string, what code would I write to "do some checks" on it, outside of a unit test? If I'm using CurlUrl to "add/delete/overwrite some parts" how is that not "using it alone as a representation of an URL"? If I'm writing a PSR-7 object, am I only supposed to use CurlUrl when interfacing with curl, and generate the string myself for other purposes? If the implementation I come up with differs from curl's, how does the user know which is the "real" URL? Regards, -- Rowan Tommins [IMSoP]