Re: [PEPr] +1 for Web Services::Services_oEmbed
| From: | till | Date: | Mon, 27 Oct 2008 18:08:35 +0000 |
| Subject: | Re: [PEPr] +1 for Web Services::Services_oEmbed | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50932@lists.php.net to get a copy of this message | ||
On Mon, Oct 27, 2008 at 7:00 PM, Joshua Eichorn <josh@bluga.net> wrote:
> David Jean Louis wrote:
>>
>>>> Ok. I'll try to finalize the parts I've started so far, and I will post
>>>> them somewhere so you can check it out and move on setting things up.
>>>
>>> Thanks, HTTP_Request2 is long overdue, hope this time we'll be able to
>>> come up with something. :]
>>
>> Ok, as promised here's the work I've done so far on HTTP_Request2:
>>
>>
>> http://code.google.com/p/izi-sandbox/source/browse/#svn/trunk
>
> I did a quick once over. I would move the Response codes and http method
> constants to your common code since they are likely to be useful outside of
> requests/responses.
>
> Also I think your design is going to start hitting snags when you look at
> the various options for making requests. pecl_http and curl can both do a
> lot of the message parsing for you and you want to use them if possible
> since they are a lot faster then anything we can write in php. (see
> http://us.php.net/manual/en/class.httpmessage.php,
> http://us.php.net/manual/en/class.httpquerystring.php,
> http://us.php.net/manual/en/function.http-parse-headers.php,
> http://us.php.net/manual/en/function.http-parse-message.php,
> etc)
>
> It may make the most sense just follow the desgin of pecl http and just add
> enough api around things to easily switch backends, and add in any missing
> features.
You raise an interesting issue.
I wonder if those things could be done using a pluggable
"HTTP_Request2_Response" class? Maybe provide an interface with a
parseResponse() (or similar) and offer a simple example implementation
so people can easily override it on demand.
Just a thought.