3 * Helper function for the terminally lazy.
5 * @copyright (c) 2006-2015 G. Giunta
6 * @license code licensed under the BSD License: see file license.txt
9 include_once __DIR__ . "/../../src/Autoloader.php";
10 PhpXmlRpc\Autoloader::register();
13 * Takes a client object, a remote method name, and a variable numbers of
14 * php values, and calls the method with the supplied parameters. The
15 * parameters are native php values and the result is an xmlrpcresp object.
18 * The function encodes the received parameters using php_xmlrpc_encode:
19 * the limitations of automatic encoding apply to this function too);
21 * the type of the value returned by the function can be changed setting
22 * beforehand the 'return_type' member of the client object to 'phpvals' -
23 * see the manual for more details about this capability).
28 * @param xmlrpc_client client object, properly set up to connect to server
29 * @param string remote function name
30 * @param mixed $parameter1
31 * @param mixed $parameter2
32 * @param mixed $parameter3 ...
34 * @return xmlrpcresp or false on error
36 function xmlrpccall_simple()
38 if (func_num_args() < 2) {
42 $varargs = func_get_args();
43 $client = array_shift($varargs);
44 $remote_function_name = array_shift($varargs);
45 if (!is_a($client, 'xmlrpc_client') || !is_string($remote_function_name)) {
49 $valueArray = array();
50 $encoder = new PhpXmlRpc\Encoder();
51 foreach ($varargs as $parameter) {
52 $valueArray[] = $encoder->encode($parameter);
55 return $client->send(new PhpXmlRpc\Request($remote_function_name, $valueArray));