Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
xmlrpcbundle | eZ Publish Legacy | stable |
Version | Compatible with |
---|---|
N/A | N/A |
This Symfony 2 bundle will let you implement an XML-RPC server without leaving the comfort of your gold old Symfony 2.
It does the following:
Let's consider this XML-RPC payload:
myAPI.getLatestContent
Some string
To process this call, all you need to do is create a route that matches /xmlrpc/API.getLatestContent, and map a
controller to it, the usual way:
myroute.getLatestContent:
path: /xmlrpc/myAPI.getLatestContent
defaults:
_controller: MyBundle:API:getLatestContent
And that's it. In your controller, you will receive a standard HttpFoundation Request, where each parameter is part
of the POST data.
An hello world example can be found inside the bundle itself.
By default, the route won't receive any parameter, and parameters from the XML-RPC request will be made available
as $_POST[0], $_POST[1], ...
In order to get more meaningful controllers, ParametersProcessor can be used.
A parameter processor must:
The interface requires two methods: getRoutePathArguments and getParameters. Both will refine the request
arguments based on the contents of the $parameters array, a numerical array of the XML-RPC request parameters.
Returns route URI arguments, as a numerically indexed array. Each argument will be added to the route's path, separated
by slashes.
This method must return an array, associative or not, of POST parameters that will be added to the request.