Closed (won't fix)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2011 at 08:25 UTC
Updated:
27 Nov 2012 at 19:41 UTC
As we use class RESTServer for our REST server I think it will be very good feature to let users use inheritance here.
Practically what I mean is to add new attribute to hook_server_info named "class".
In this case in services_endpoint_callback() instead of calling
print call_user_func($server . '_server');
We would load server class and run:
try {
$server = new $server_class;
return $server->handle($canonical_path, $endpoint_path);
}
catch (Exception $e) {
$server->handleException($e);
}
And if developer will need to change some behavior inside the class he can easily change the class of server using hook_server_info_alter and inherit his own class from RESTServer.
Comments
Comment #1
marcingy commentedThis won't work with xmlrpc as it is not a class, that would mean that we need to rewrite xmlrpc as a class and have a defined base class for all servers. Which is itself a good idea but I'm not certain it is a 7.3 thing because it requires a major rewrite of sub system. If xmlrpc was no longer in core of course this would be much easier.
Comment #2
ygerasimov commented@marcingy truly to say we know that xmlrpc is not in the best shape anyway and it would be good to rewrite it.
But lets postpone this issue.
Comment #3
marcingy commentedThis looks like an ideal 7.4 target.
Comment #4
kylebrowning commentedWont fix in 3.x but ive added it as a list of things to do for 4.x