Re: [PEPr] +1 for Web Services::Services_oEmbed
| From: | till | Date: | Mon, 27 Oct 2008 18:32:54 +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-50938@lists.php.net to get a copy of this message | ||
On Mon, Oct 27, 2008 at 7:23 PM, Joshua Eichorn <josh@bluga.net> wrote:
> Joe Stump wrote:
>>
>> On Oct 27, 2008, at 11:08 AM, till wrote:
>>
>>> 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.
>>
>> I like this idea. PDO does this with custom result classes and it works
>> rather nicely.
>>
>> --Joe
>>
> Its a bit harder then that since some backends give you back information
> pre-parsed instead of providing a function to parse them (curl, the http
> stream)
>
> -josh
The default could be string and we provide an example for curl using
the http stream as well. The end-user could still override it if they
want something different.
"parseResponse" was probably the wrong example name. I mean something
like "handleResponse" - it would return the response, or reference of
the stream and the user can do whatever they want with it. Or they
provide a custom _Response class and do something else.
Till