views:

89

answers:

2

I would like to know what existing PHP libraries/classes have you used for your REST+JSON projects.

If I need to create a wrapper for social engines API such as Facebook and/or Twitter API, what existing PHP REST JSON architecture do you recommend?

JSON CONSUMING DEVICE (not PHP based) <--> PHP REST SERVICE <--> SOCIAL API

+4  A: 

If all you need is a RESTful client, then I don't really see why you need a framework at all.

You can use e.g. the curl libraries to do an HTTP request (or even plain sockets), and then json_decode & json_encode for the JSON. That's it. That's your client right there. REST is not more than that.

I'm sure there are wrappers around PHP's curl library that are a little bit more intuitive for the RESTful "I just want to GET/POST/PUT/DELETE some data" approach, but then again it's at most 20 lines of code to roll a class that does that yourself.

skrebbel
+1  A: 

Zend Framework has a REST library available, with client and server, as well as the REST route and controller. It also has context switching available, so it's easy to switch output to XML, JSON, or whatever you want if you extend it. There is also a Twitter service available, although I haven't tried it.

Cez
Off topic, I guess, but Zend_Rest_Server has absolutely nothing to do with REST. They pass methods as URL parameters and do nothing with resources. It was clearly only included for buzzword compliance reasons by an intern, in two days.
skrebbel
Fair point, but it depends upon the implemention. I have added a link to the information about RESTful routing
Cez