In the RestServer::call method you have:
if($class instanceof RestAction) return $this->call($class);
I don't see how this could work without the script entering an infinite loop. Because, everytime you initiate a RestAction (or a subclass which is an instance of RestAction), it will call RestServer::call infinitely.
Can you provide an example of a subclassed RestAction and how it would work?
Diogo Souza da Silva - 2009-04-20 14:06:49 - In reply to message 1 from Ignatius Teo
RestAction implementations are the RestController and RestView interfaces, it represents a possible handler for the Request.
$class will be the return of a RestController or a RestView (both are RestAction), this test is to see if any of those return'd another RestAction( controller or view) that should be called later.
When a request reach it end, or if there should be no more classes to call, the current action should return the RestServer.
In example2, controller/HomeController method execute(RestServer) return an instance of HomeView. This is where this code will work, as HomeView implements RestView, witch is a RestAction, the RestServer will proceed the request with HomeView show(RestServer) method.
Them as HomeView show() do not return a RestAction(it returns the RestServer), the RestServer ends the request and show the headers and output.
It would loop infinite if the controller/view method return it self or the next class return it's caller.