views:

301

answers:

6

Is there any really lightweight RESTful frameworks around that assumes its users to be not newbies?

I am looking for something that is based on the below criteria

  1. One that models resources ( for RESTful-ness )
  2. Object oriented ( not just for the sake of it )
  3. Not one that forces to use MVC
  4. No unnecessary fat ( strange database layers and ORMs )
  5. Pay for what I use ( nothing is automatic, but gives me means to make them automated )
  6. Sensible logging ( unlike kohana )
  7. Sensible configuration ( unlike kohana, not every techie is a PHP programmer )
A: 

PHP Fat-Free Framework. The name alone is enough to let you know what it stands for.

stillstanding
Looks nice, but it has no focus on REST, has it?
Pekka
Routing is at the core, not an adjunct, unlike other frameworks. REST is a cinch with F3::map().
stillstanding
@hoohah the fat-free framework seems pretty good. but not that straight forward! But much better than a lot of them out there.
CodeMedic
A: 

zend framework include baisc zend libraries to support REST http://framework.zend.com/manual/en/zend.rest.html

Elvis
the server part is what I was more interested in... Zend implementation looks so basic and (sorry to say) tacky!
CodeMedic
+1  A: 

I would say Tonic, build with the excellent RMR Web Architecture article in mind, by the article's writer: Paul James.

I haven't tried it out myself, but it applies to most of your requirements:

  • Is the most RESTful framework I've seen; it treats every URL as a resource;
  • Applies RMR over MVC, since MVC does not really apply for the web (at least not in server-side scripting)
  • Is very light weight
Peter Kruithof
Good find ...! I very much liked the RMR concept; its very close to what I was looking for. To me it almost sounds like its a special case of MVC where the "Model" models the HTTP resource.
CodeMedic
It does tick quite a few boxes! Thanks Peter.
CodeMedic
Glad I could help!
Peter Kruithof
A: 

Maybe CodeIgniter 2? Sources are available on BitBucket.

Maybe you could apply this too on current stable CodeIgniter: http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/

Didn't try though...

I know this might not be 100% what you want, just trying to give you a hand with some alternative...

Good luck!

JiPi
It does look like a cleaner implementation, and having worked with Kohana which is a derivative of code igniter, I can understand how it works. BUT having said that, it is a platform that I couldnt really connect to in the context of RESTful service. Its such a framework that kinda binds its users into MVC for no real reason. But having said that Kohana doesnt really enforce a rule ... you could just have a controller that does everything...
CodeMedic
A: 

I've been using Zend_Rest for a project. If you are using its own MVC structure, setting a REST server is painfully easy to do (I know you specifically asked for one that did not force you to use an MVC structure). Of course Zend_Rest can also be set up without its own MVC like so (straight from the docs):

$server = new Zend_Rest_Server();
$server->setClass('My_Service_Class');
$server->handle();

The above will use your class to answer REST requests. If not, you could add hand picked functions to your server:

function sayHello($who, $when)
{
    return "Hello $who, Good $when";
}

$server = new Zend_Rest_Server();
$server->addFunction('sayHello');
$server->handle();

To call sayHello from the example above, you can use either:

?method=sayHello&who=Davey&when=Day

or:

?method=sayHello&arg1=Davey&arg2=Day

API Docs for Zend_Rest:

http://framework.zend.com/apidoc/core/Zend_Rest/Server/Zend_Rest_Server.html

Julian
sorry to say, it looks clunky and less straight forward. Zend must be ashamed of themselves to call it RESTful!
CodeMedic
@CodeMedic, what's clunky about three lines of code? I believe I gave you a full answer with working examples and docs links, yet you vote it down because it's not the one you would choose to work with? It's not Zend who should be ashamed (for creating prefectly usable code) but you for voting down something that could be useful for many others just because you think is "clunky" and for not even providing any insight in why you think is clunky.
Julian
Straight from stackoverflow's own FAQ: "If you see misinformation, vote it down. Add comments indicating what, specifically, is wrong". I don't see my comment as misinformation and I don't see any comments from you indicating what's wrong, so your vote down is completely undeserved.
Julian
@Julian I'm sorry if I have offended you. If you have carefully read through my initial posting; I was looking for a framework that models RESTful resource and not RESTful RPC. A RESTful service is not a special case of RPC.
CodeMedic
+1  A: 

May be MultiRPC will be good for you. It supports multiple call by one request and use encrypted and compressed protocol.

SeniorDev
An RPC helper is far from being classified as a framework
stillstanding
and RESTful service is not just about RPC or remote method invocation.
CodeMedic
And thats why I wrote "May be"
SeniorDev