Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118102 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75194 invoked from network); 27 Jun 2022 06:14:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2022 06:14:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D6F818050B for ; Mon, 27 Jun 2022 01:05:26 -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-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 01:05:25 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id q5so6462639wrc.2 for ; Mon, 27 Jun 2022 01:05:25 -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=j1N/pLcW6BF0bY6m47Bu9JVwC49jr+v2EQ0JPCmaORs=; b=F4htkSynO9Aju2TnxSe++jiE7xV68zICSB2/m5QBNnaN6tpOR+YdKIKfSP7YOEHY9m Pf78CSs9YqisQxUAY00wra14k4wsRDGpVeVB7dhM2xbYLYxuyyrq6i+7P1s3FVwnC+2F AvuQm1BtGGPlQG1TboYyqavmGLZCmhwWVAvg8unYibDQUhGtjg5vrFOkpoyjcSzWQNOy zTjmYZ9Q7srAjPRf+nOrZHpZlnbJ00MTFE54obf/Pg2GcUfw6YUmGH8+M2cHKdIFNCuQ jg0e7PLZgnkjYnNf9yXNRJSCCorRPyqT7OD1XAV0kRZTmdCtj7u7tUORtNUNTHbHCDjD L5ig== 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=j1N/pLcW6BF0bY6m47Bu9JVwC49jr+v2EQ0JPCmaORs=; b=mEYU1z9P8JQyYU/4RsaFu3sBjfPXW9ji62chEvfNX37l0/kp10BTspOqQGXzctB496 fZ54WHSipXgHVvos6FHpNhjJA3b3V2zfiLf4LgkMhX4SFO8Fy2KgsD/BGOZn+lLeVise G2Hlv4uYuZnWOsn4cBCgpk3gkmznjGnza2WLNuGVcTkFU6IyJLyzD6NR2945wnlIPB14 027gXK6X1lrNeZEcqkXWDf0EED4WZLaSaxtV8AljTXTqaIjHOvu0Yo7ldAe6KOqpiHvl idenzq3WBo1r3JIT1yASoOBmqsyut/mXoxGJmyqYHjybDlxmU8uTXs3lF5pxPcupHeBE hXHA== X-Gm-Message-State: AJIora8Hjdh3d7IjQb+jmbl/ckTGDH057ozfNd12/Xt2VuR3ldnYk/My sjcvNkgKf8LZSMY3jidfM0goLwd/aD0= X-Google-Smtp-Source: AGRyM1seWHeiDUp8UvYtX9Pe638jbakWfVJ38z6t6C+oNsBL3QRSP2PKMw/bPJcbixOvEgLQPvNSPQ== X-Received: by 2002:a5d:59af:0:b0:21b:b69b:318c with SMTP id p15-20020a5d59af000000b0021bb69b318cmr10956032wrr.598.1656317124458; Mon, 27 Jun 2022 01:05:24 -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 c7-20020adffb47000000b0021b9504cc83sm9674329wrs.31.2022.06.27.01.05.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 01:05:23 -0700 (PDT) Message-ID: Date: Mon, 27 Jun 2022 09:05:22 +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: 8bit Subject: Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API From: rowan.collins@gmail.com (Rowan Tommins) On 27/06/2022 07:29, MichaƂ Marcin Brzuchalski wrote: > CurlUrl is for me is a mix of Url/Uri object properties well known from > other userland implementations like the PSR one > with Uri specific like the host, scheme, port, path, query, fragment, etc. > but on the other hand, we have flags and options which > purpose is to pass Curl specific things but in IMO wrong place Rather than a *representation* of a URL, think of the class as a *builder* for URLs. There are multiple methods because you might want to build the URL in different orders ("start with this URL but replace the port", "start with this domain and I'll add the path later", etc). All the flags are related to how the input should be interpreted, and the output manipulated, in order to build a correctly formatted URL string. Maybe it should even be called CurlUrlBuilder? That also fits with the design of having mutable setters; as Derick pointed out, mutable value objects are generally a bad idea, so it would make sense to encourage users to think of this as a way to get one or more strings, rather than as a result in itself. Regards, -- Rowan Tommins [IMSoP]