Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118107 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97552 invoked from network); 27 Jun 2022 11:27:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2022 11:27:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E3BEC180539 for ; Mon, 27 Jun 2022 06:18: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.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 06:18:17 -0700 (PDT) Received: by mail-pj1-f54.google.com with SMTP id h9-20020a17090a648900b001ecb8596e43so9398277pjj.5 for ; Mon, 27 Jun 2022 06:18:17 -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=Lyag6F74Sb5AmrE/qUdeiXgsqpRmlDPXIotPyWS+cco=; b=Li+YvQ3t2AxgEo2Ty3WeRGsMB+qDG8AUT3eA4SACUODaKDbqq+9LpyeYVqR4Hc8S6d ZlEkd7QYlupDfr0YlB9QOuiAppGjLOZpnGLbwh8fe6MXSTZaYOteMBqEVQuppgGJignG oBgrW7ov+bn40RYkDKblCphQ/vSNrap0r4gWJwXY6K+4Pmsby+aCjocKZHnNeLcs4f6Y XRjAh2Cisl7eJ7/vME7su6pbwZaVS07lAMCgUDFUG+ctdXaEAEezJ5WpYZAG9MabS0P8 31XgIITcKkkvZysEwEjGbjqxaOdtG+XNf9gOS8Snxzbo4xRMi83Qjef3+5xdM6XLCpOY ih0w== X-Gm-Message-State: AJIora9DxddmYN5S0GmqAHI4P0hsmQxv36mlD/UWEJFxRN3kCpHbB8VY 508LKudu4Ah9MUMfmFCiBy8bLdHUxFtZqnH6Xjxcq7QQWg0= X-Google-Smtp-Source: AGRyM1uo1F5E3cianXCx2LjdbZP65B5NuOCgfJgS1GvI4DRQSkAQn/GkOh0Z/aCaloYwj/u5W1/fLO2ufWnhZqiyaBc= X-Received: by 2002:a17:903:1248:b0:168:d2ba:ee71 with SMTP id u8-20020a170903124800b00168d2baee71mr13970543plh.150.1656335896401; Mon, 27 Jun 2022 06:18:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 27 Jun 2022 09:18:05 -0400 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000bbed8005e26dc03c" Subject: Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API From: pierrick@php.net (Pierrick Charron) --000000000000bbed8005e26dc03c Content-Type: text/plain; charset="UTF-8" Hi Rowan > > 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. > Sorry if it was really not clear in the RFC since I didn't even talk about the CURLOPT_CURLU option, but this class is not only there to parse/build strings for Curl but to give this specific object to Curl instead of a string representation of an URL. > > 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. > Since you can give this object to curl instead of an URL string, I would not call it CurlUrlBuilder. Regards, Pierrick --000000000000bbed8005e26dc03c--