Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118080 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21090 invoked from network); 24 Jun 2022 11:59:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2022 11:59:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A57118037E for ; Fri, 24 Jun 2022 06:49: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=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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, 24 Jun 2022 06:49:40 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id q9so2854608ljp.4 for ; Fri, 24 Jun 2022 06:49:40 -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=/C7QlRXk4sBApd71lwvLsKcUV7+dT4mHokOJ02FGzq0=; b=KICO469Wqd4lfCoth/AY3IimPpoI7DTZb3gERQXWn06mVwQB/1Sm/OAVpEDlj2+IMw MYmibSEzvUKdDyVkZZ6r/PiQYadhxwta1/ql/AVo+RsHKF9C3Ol5Et8mrBv0BQ8gBsD6 ZbCzVrtsZvk8OTlgTzUCFe59jVsbpXkAhbQmkaFHQmxAkz/PJXccKi5697wPkWhlXT3C lX18ArAebjugs6i/GERQjWF9urnA/UU6jmZdiMttF802Swbweos3zZH+I/LQiOj/APWh OrImf69MMRQOkTYe7ZH7mNluP7nweoAqxtsGKHSEb9xl56LbFYdLf9zv6eWtSNAW35rK KN5A== X-Gm-Message-State: AJIora+U318p5ZBKGpprZv/hpv8SoS9gHrqlSj+G9ufLyktJhZ4JQSbN pnKWCYCx4VaH0im1U9tk244DwKbbcOOAHD+LeNUf8Nd3/DYYSA== X-Google-Smtp-Source: AGRyM1uffE3Yo1bYkHV+MF34YYM5ja5x11XlrqeBbqfP2ifdzZW/s1fTTJS6Ut/gB0EHkStRshIp902BFQRVvtciiNw= X-Received: by 2002:a05:651c:893:b0:249:4023:3818 with SMTP id d19-20020a05651c089300b0024940233818mr7864881ljq.44.1656078578721; Fri, 24 Jun 2022 06:49:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 24 Jun 2022 09:49:27 -0400 Message-ID: To: Levi Morrison Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000067c42705e231d7cf" Subject: Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API From: pierrick@php.net (Pierrick Charron) --00000000000067c42705e231d7cf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, and thanks Levi for your feedback, If you look at the first thread (Discussion about new Curl URL API and ext/curl improvements) you'll see that this was my first approach. I even proposed to "OOPify" the actual CurlHandle & co objects with "simple" methods like $ch->setOpt(). Anyone who reads the actual API can see this is the actual "philosophy" of the extension. It was designed (on purpose or not) as a thin wrapper over curl. But lets focus on URL API only ! With previous thread answers, I was under the impression that I really was the only one liking the approach of following the cURL api as much as possible and leaving the more high level API to things like Guzzle & co (for example by adding an Implementation of PSR-7 UriInterface using this API) since all the others parts of the API are done this way. I think it's important to have this new Curl URL API in 8.2 since it fixes security issues and that's of course not ideal but I would rather have an implementation that would not be my first choice, than not having it at all= . What do you think ? I would love more people to give feedback on what they are expecting, if they don't care if they prefer one approach or the other and of course why ? I was thinking about doing a vote on this, but I'm not sure it's a good idea. What do you all think ? Regards, Pierrick Le jeu. 23 juin 2022, =C3=A0 12 h 49, Levi Morrison a =C3=A9crit : > On Tue, Jun 21, 2022 at 10:38 PM Pierrick Charron > wrote: > > > > 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 > Curl > > URL API and put aside all other improvements. Here is the RFC that > reflects > > our current conversations. > > > > https://wiki.php.net/rfc/curl-url-api > > > > Feel free to give any feedback, concern or support :-) > > > > Regards, > > Pierrick > > IMO, this should mirror the low-level curl url API very directly. The > basis of my opinion is that we do not own libcurl; we are merely > adapting it for use in PHP. We cannot anticipate changes in their > design, nor do we have authority to do so if we feel something should > change. Touching it as little as possible makes it easier to track > upstream changes, etc. > > Based on that, I think the naming should be closer to libcurl.: > - CurlUrl::URL_ENCODE should be CurlUrl::URLENCODE > - CurlUrl::URL_DECODE should be CurlUrl::URLDECODE > > And so on, only differing if necessary because something is a reserved > word. The API should be as exact as possible to what libcurl provides. > The "helpers" getHost, getPassword, etc should be removed and should > expose `curl_url_get` more directly. > > Of course, it should be object based instead of resource based, but that'= s > it. > > A nicer API can be built on top of it, but I don't think that's the > role this particular API should play. > --00000000000067c42705e231d7cf--