Re: [RFC] [Under Discussion] New Curl URL API

From: Date: Mon, 27 Jun 2022 13:18:05 +0000
Subject: Re: [RFC] [Under Discussion] New Curl URL API
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-118107@lists.php.net to get a copy of this message
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

« previous php.internals (#118107) next »