Recommended PHP REST frameworks / Libraries

1 view
Skip to first unread message

Sam Keen

unread,
Sep 1, 2010, 1:02:08 PM9/1/10
to pdx...@googlegroups.com
Starting a new projects and I was curious what PHP REST servers folks
have been using?

--
Sam Keen
@samkeen

Christopher Thompson

unread,
Sep 2, 2010, 3:32:13 PM9/2/10
to pdx...@googlegroups.com
Sam,

Did you get any responses to this question? You mentioned REST
servers, frameworks and libraries. Not sure which on of those (or all)
you were looking for? Also, as REST is a slightly fuzzy term, what
specifically you were interested in?

Christopher

> --
> You received this message because you are subscribed to the Google Groups "PDXPHP" group.
> To post to this group, send email to pdx...@googlegroups.com.
> To unsubscribe from this group, send email to pdxphp+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pdxphp?hl=en.
>
>

Patrick K. Clark

unread,
Sep 2, 2010, 2:59:42 PM9/2/10
to pdx...@googlegroups.com
Sam,

I've spent some time looking into Recess recently, but was not a big fan of the semantics or structure and, for all the other heavy lifting you expect of a framework, it fell really clunky.

I wound up rolling my own little REST pattern in Kohana 3. It's basically just a one line of routing and a simple catch-all controller with a single action that loads a model corresponding to the appropriate URI segment, calls the method in the model based on the HTTP verb, and spits back a JSON response. It's being built as a back-end to a Dojo-based single page app. I'm still in the process of wrapping the Authorization module around it to control access to specific resources based on user. Let me know if you're interested in the code and I'll pop it up on github.

I didn't use Ko3's Controller_REST implementation since I don't like how it "translates" the HTTP method into various actions. Since in my case requests are uniformly processed and responses are always JSON serialized from the model's return value, I thought that was just extra complexity. The real work winds up in your models regardless.

Patrick K. Clark
@pkclark

Sam Keen

unread,
Sep 3, 2010, 12:36:46 AM9/3/10
to pdx...@googlegroups.com
thanks for the replies,
Christopher, sorry for the vagueness. Really looking for a RESTful
micro MVC system. Something that complies with proper use of HTTP
method and responses.

Patrick, funny you mentioned Kohana3, I'm a big fan and have also
built a quick and dirty RESTful framework with it. It is a good
compromise, as frameworks go, KO3 is pretty quick, so you get some
benefit of the framework but the system still has decent response
times.

regards,
sam

> --
> You received this message because you are subscribed to the Google Groups "PDXPHP" group.
> To post to this group, send email to pdx...@googlegroups.com.
> To unsubscribe from this group, send email to pdxphp+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pdxphp?hl=en.
>
>

--
Sam Keen
@samkeen

Christopher Thompson

unread,
Sep 3, 2010, 2:08:28 AM9/3/10
to pdx...@googlegroups.com
Sam, it sounds like "micro" is the thing you are looking for in a
framework. Most of the major frameworks have a REST controller
solution (e.g., CakePHP, CodeIgniter/Kohana, Symfony, Zend). They all
do about the same thing which is map GET, PUT, POST, and DELETE onto
action methods. The usually add a parameter convention to support
PUT/DELETE manually. Patrick said he did not like how Kohana3 did
this, so I am wondering what the variations are that make a REST
implementation acceptable or not acceptable.

I agree with the micro aspect, which I think is in the spirit of REST.
Some solutions for the major frameworks seem to make complex what is
supposed to be simple -- mostly because of feature creep. I'd be
interested to know what you guys consider necessary for a minimal REST
implementation and what specifics you prefer.

Richard Shank

unread,
Sep 3, 2010, 2:17:16 AM9/3/10
to pdx...@googlegroups.com
I must admit I've only been half way reading this conversation, but it triggered a thought.  http://github.com/avalanche123/MicroKernelBundle I haven't tried it so I can't say how well it works, but it may be what you need.

Richard


--

Sam Keen

unread,
Sep 3, 2010, 12:58:43 PM9/3/10
to pdx...@googlegroups.com

Thanks Richard,
Even thought I don't see us using symphony, example like that are what I was looking for.  Even if you are not going to use something , studying it is valuable.  I have the tenents of what makes something restful down. Just looking for examples what projects have done to automate adhereing to those priciples.  Leaning twards simple, small solutions as I agree, the core strength of rest is simplicity, so a framework claiming to be restful should also be simple.

Thx again for the feedback

On Sep 3, 2010 9:48 AM, "Richard Shank" <iamper...@gmail.com> wrote:

I must admit I've only been half way reading this conversation, but it triggered a thought.  http://github.com/avalanche123/MicroKernelBundle I haven't tried it so I can't say how well it works, but it may be what you need.

Richard



On Thu, Sep 2, 2010 at 11:08 PM, Christopher Thompson <christophe...@gmail.com> wrote:
>

> ...

--
You received this message because you are subscribed to the Google Groups "PDXPHP" group.

To pos...

Richard Shank

unread,
Sep 10, 2010, 3:56:39 AM9/10/10
to pdx...@googlegroups.com
Sam, if you are still looking another example http://github.com/b00giZm/sonata-framework

Sam Keen

unread,
Sep 10, 2010, 5:04:19 PM9/10/10
to pdx...@googlegroups.com
thanks Richard, I'll take a look. I like what's said in the readme file.

--
Sam Keen
@samkeen

John Steele

unread,
Sep 10, 2010, 5:34:40 PM9/10/10
to pdx...@googlegroups.com
Sam,

  Even if you don't use the CodeIgniter framework, you might want to
take a look at these 2 libraries hosted on GitHub (Rest Client and
Rest Server): http://philsturgeon.co.uk/code

  Although this article is from last year, it and some of the comments
are worth the read:
http://philsturgeon.co.uk/news/2009/06/REST-implementation-for-CodeIgniter

FYI,
  John
-------
/* Steelesoft Consulting John Steele - Systems Analyst/Programmer
* We also walk dogs... Dynamic Web Design, PHP/MySQL/Linux/Hosting
* http://www.steelesoftconsulting.com/
*/

Sam Keen

unread,
Sep 10, 2010, 5:51:51 PM9/10/10
to pdx...@googlegroups.com
Thanks John,
I did actually start working with Phil's REST_Controller. At a
minimum it is a good stating point and allows us to get rolling
quickly since we are already using CI.

would be great if someone wanted to demonstrate one of these
frameworks at the next meeting, hint, hint :)

regards,
sam

John Steele

unread,
Sep 10, 2010, 6:21:47 PM9/10/10
to pdx...@googlegroups.com
Hi Sam,

Unfortunately I don't make it up there often enough; I'm stuck here
south of Ashland where it can take me up to 20 minutes to go snow
skiing :)

He does have a nice tutorial on nettuts though:

Working with RESTful Services in CodeIgniter
http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/

He also created a standalone version (non-CI) on CodeCanyon that I
have not tried, but for only 7 dollars, it's probably worth looking
at:

Tiny Rest Framework
http://codecanyon.net/item/tiny-rest-framework/99263

BTW, congrats on the new ShopIgniter job! Put me down for a
standalone version when they come out with one :)

John

Reply all
Reply to author
Forward
0 new messages