Why we have not added the Request Adapters for Http

36 views
Skip to first unread message

Hari K T

unread,
Jan 7, 2012, 7:41:59 AM1/7/12
to aur...@googlegroups.com
Hello Guys, 

@Galestic Void : You have been working with the Aura.Http Request and I noticed something for CURL too . But I still wonder why you have not forked the same repo so we can just fetch from your repo and do the necessary changes. As it currently resides in Nursery either we want to manually copy and do it .

@Paul I am not sure why the Request is not incorporated still . Do you think it should be moved to another package ?

I will try to port the Request from Solar if needed, especially the Streams .

Let me know what your thoughts are .

Lee

unread,
Jan 7, 2012, 11:51:43 AM1/7/12
to aur...@googlegroups.com
Sorry about that, I meant to have this done a few months ago. 

The Stream adapter and tests for the adapters are only major things left to do, though I'm not sure how to properly test the adapters without a server. I havent looked into it yet but maybe the server in PHP 5.4 could be used. Unless someone has a better Idea?

Does anyone have any thoughts thoughts, ideas or needs with the current implementation? In particular the RequestAdapter design, as I feel it could/should be better.


Paul M Jones

unread,
Jan 7, 2012, 12:42:07 PM1/7/12
to aur...@googlegroups.com

On Jan 7, 2012, at 10:51 , Lee wrote:

> Sorry about that, I meant to have this done a few months ago.

Not at all, sir, we've all had a ton to do. Hell, I haven't had time to work on Aura myself until the past few weeks.


> The Stream adapter and tests for the adapters are only major things left to do, though I'm not sure how to properly test the adapters without a server. I havent looked into it yet but maybe the server in PHP 5.4 could be used. Unless someone has a better Idea?

That sounds like a neat idea. I can't think of anything else at this point.


> Does anyone have any thoughts thoughts, ideas or needs with the current implementation? In particular the RequestAdapter design, as I feel it could/should be better.

These are only suggestions after looking at it for about 20 minutes:

- I'm betting that RequestAdapter should become AbstractRequest.

- We have an Aura\Http\Cookies object now; the Request should probably use that instead of an array. You may wish to combine ResponseCookies with Cookies. (We could probably use a Cookie object and a CookieFactory at this point as well.)

- We also have an Aura\Http\Headers object now; the Request should probably use that instead of an array. You may wish to combine ResponseHeaders with Headers. (We could probably use a Header object and a HeaderFactory at this point as well.)

- It may be that we need a ResponseBuilder object to put together Response objects from Request returns.

- It may be that we need to separate the Request object from the way the request is transmitted; e.g. new Request(new CurlTransport, new ResponseBuilder).

- I like the idea of the SplStack of responses. Having said that, I think we need to rename RequestResponse to just Response, and create a ResponseStack object (that is a stack of Response objects).

Incidentally, I've been looking at Buzz and it looks pretty clean:

<https://github.com/kriswallsmith/Buzz>

It may present some ideas for you.

--

Paul M. Jones
http://paul-m-jones.com/

Hari K T

unread,
Jan 7, 2012, 12:47:51 PM1/7/12
to aur...@googlegroups.com
Sorry about it , but I don't know how to test the stream :( really . 

But can't we do something like having a local test file and trying to get it , and comparing with the static value we have in mocks ? Not sure though .

May be Paul have some insights on this .

But its always a good thing that you can fork it . Please ..

Hari K T

unread,
Jan 7, 2012, 12:51:52 PM1/7/12
to aur...@googlegroups.com
Buzz is one , there is another one also https://github.com/guzzle/guzzle 

Paul M Jones

unread,
Jan 7, 2012, 1:20:36 PM1/7/12
to aur...@googlegroups.com

On Jan 7, 2012, at 11:51 , Hari K T wrote:

> Buzz is one , there is another one also https://github.com/guzzle/guzzle

Looks kinda heavy: Zend, Monolog, Symfony dependencies. But, can't hurt to look at it.

Hari K T

unread,
Jan 7, 2012, 1:42:43 PM1/7/12
to aur...@googlegroups.com
Sorry I just have read the documentation . Not looked more , But Pear 2 has also one .

Hari K T

unread,
Jan 8, 2012, 1:40:01 AM1/8/12
to aur...@googlegroups.com
About the name , from RequestAdapter to AbstractRequest .
On Sat, Jan 7, 2012 at 11:12 PM, Paul M Jones <pmjo...@gmail.com> wrote:

On Jan 7, 2012, at 10:51 , Lee wrote:

> Sorry about that, I meant to have this done a few months ago.

Not at all, sir, we've all had a ton to do.  Hell, I haven't had time to work on Aura myself until the past few weeks.

No I was not blaming you @Lee nor anyone . I just wanted to know things, ie all .

> The Stream adapter and tests for the adapters are only major things left to do, though I'm not sure how to properly test the adapters without a server. I havent looked into it yet but maybe the server in PHP 5.4 could be used. Unless someone has a better Idea?

That sounds like a neat idea.  I can't think of anything else at this point.


> Does anyone have any thoughts thoughts, ideas or needs with the current implementation? In particular the RequestAdapter design, as I feel it could/should be better.

These are only suggestions after looking at it for about 20 minutes:

- I'm betting that RequestAdapter should become AbstractRequest.

What I see is here its an interface , so there will be confusion over the name. Either we should name it as InterfaceRequest or make the class abstract itself naming some method abstract .

Lee

unread,
Feb 24, 2012, 10:41:25 AM2/24/12
to aur...@googlegroups.com
@Paul I've made the changes you suggested and finished the unit tests the only exception being the adapters. 

At this point I think it is close to ready unless anyone see any problems or has any suggestions. 
One suggestion from Hari is that Headers and Cookies become HeaderCollection and CookieCollection.

You can find my fork of Aura.Http @ https://github.com/galactic-void/Aura.Http

Hari K T

unread,
Mar 8, 2012, 4:52:09 AM3/8/12
to aur...@googlegroups.com
Hi Lee ,

I did looked into the tests . One suggestion is we want to move the test files according to the folder structure or namespace for the src files .

For eg : See the view Helper and the tests .

https://github.com/auraphp/Aura.View/tree/master/tests/Aura/View/Helper

Currently all tests are in a single place , which is hard to track it .

What do you think ?

Hari K T

unread,
Mar 27, 2012, 2:45:54 PM3/27/12
to aur...@googlegroups.com
Hi Guys, 

@pmjones Do you feel we want to wait till an API for Request is formed by PSR ?

Or is it ok we can merge for Beta3 ?

@Lee , 
$response[0]->getContent()
So I have a thought after playing with getContent() , I am not sure whether we want to use $response[0]

The below one sounds better 
$response->getContent()
What do you feel ?

If we want to move through , can't we use push /pop like stuffs ? Just a thought .
Reply all
Reply to author
Forward
0 new messages