Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118098 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61391 invoked from network); 27 Jun 2022 04:39:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2022 04:39:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE78E18037E for ; Sun, 26 Jun 2022 23:29:41 -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,HTML_MESSAGE, 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-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (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 ; Sun, 26 Jun 2022 23:29:41 -0700 (PDT) Received: by mail-ua1-f44.google.com with SMTP id l7so2818047ual.9 for ; Sun, 26 Jun 2022 23:29:41 -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 :cc; bh=Aap8CmAX2+ADE76rvIhS815kwGegGFba6tx8ZWjCask=; b=P99qYOW36e4h9fcInyL2gB3mtBeCSWe+ZFRNFy00M+K06hmDrWtpedZ6C88Gc0imEA lJrZs9DXKdacUDX173AwLxsBBgC/DoX0H/8qcD+MeAuaK+6HVxrnQuud0Nhu+AxmFy9B 8pu7Un0ubg5kGjc/cVugHf19+XPZ5XRJvBujhWW8D/ttsJiO8w8OZOfv6aCOqliP2Ltu oPOwB4681qA6+AJhPwHL/F7e2MNz5P7QZenoQXnyRg4mTOu01Qn4fKPFpQR5iDMYN8JK nQ+4w0pKYJEAvyr0FA1c2j/b+FLi4vZxmd/qXlpsYFi7uCn9/bul2+2ox3G1SYopU1jN 5Z4Q== 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=Aap8CmAX2+ADE76rvIhS815kwGegGFba6tx8ZWjCask=; b=NralGq0EXLi/VrMwlVA3+FXOpJwKCCpAJD40uDgtK9Mhk3EQYB9wPaBrK7Y6dCxNUc C+MTdTubwmc6FkcdNEYLtarDGt0pP7B3Ij4UqorlVG4XyLWKLqMdWGHyXog1/wxblUov 3VJFwpl/GK2y7DdiSyPMyLtBscjXXgrX/4+14rFT/IC3hKVqd/dX36j82O5FbKhXLqVR MkXSi10sdbu7nYzE3fMmG3NDeeqzgznuf4OEFMVoK3c3eZrM2h2jWUtFF3gzOP0r1Pcb q4Vz9Q7RTx/FkW3DGkLvDtS5PGx9R8FfgGFQJDhV1Km3cFdbWfH9GaDSsQs1NlZA4Ubb MZrA== X-Gm-Message-State: AJIora/lmxBDVWTXIE6/w397VZfkyTWT4VzKDrJisTRcIfkexEbKl/3s /1fDBdv8M3ykZssRardUHry7+u5YE6sxDZ4SEQrnN4pKA9UCtg== X-Google-Smtp-Source: AGRyM1s5uoO01r2dCU2Ud4P9iQbWaRoshCCzUDx2VM1Hr7px7uaFkZ9hTqVtcfsuuWXGR76bN2A8MB1+iLCB/CSlb1I= X-Received: by 2002:ab0:2810:0:b0:381:ef69:586a with SMTP id w16-20020ab02810000000b00381ef69586amr92969uap.17.1656311380657; Sun, 26 Jun 2022 23:29:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 27 Jun 2022 08:29:29 +0200 Message-ID: To: Pierrick Charron Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007b4bc405e2680b30" Subject: Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?=) --0000000000007b4bc405e2680b30 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Pierrick =C5=9Br., 22 cze 2022 o 06:38 Pierrick Charron napisa=C5= =82(a): > Hi, > > Following our discussions we had on the subject of the new Curl URL API, > and other curl improvements. I decided to only focus on adding the new Cu= rl > URL API and put aside all other improvements. Here is the RFC that reflec= ts > our current conversations. > > https://wiki.php.net/rfc/curl-url-api TBH I have a problem with the proposed Curl* classes. IMO they present a mix of responsibilities that I don't like. 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 instead (for instance Guzzle use separate argument in all methods for options and flags. Secondly, it has some default logic like `setScheme` allows to put a scheme but requires the supported one, with an exception that you can ignore support checking by a flag - IMO this logic belongs to its consumer logic and is not part of URL class logic and the `setPort` like above. Next thing is that it again has all the getters and setters and is not immutable. Why can't it be a simple constructor with read-only properties, no getters, no setters? Maybe I miss some discussion about why here. The same goes for CurlException which looks like is an exception for handling some encoding of Url and not exactly to the Url properties itself. But with all that said, if the target audience is only a user of low lever `curl_*` functions rather than users of higher abstraction libraries like Guzzle or Httplug then, I guess I don't care that much. I'm only afraid that such a mix of responsibilities can lead to bad habits when it gets to the separation of concerns by developers who get used to it and won' see the problem as I do. Cheers, Micha=C5=82 Marcin Brzuchalski --0000000000007b4bc405e2680b30--