@@ -340,25 +340,21 @@ function xmlrpc_base64_get_xml($xmlrpc_base64) {
340340 return '<base64> ' . base64_encode ($ xmlrpc_base64 ->data ) .'</base64> ' ;
341341}
342342
343- /**
344- * Perform an XML-RPC request.
345- *
346- * @param $url
347- * An absolute URL of the XML-RPC server
348- * @param $method
349- * The method to be executed
350- * @param ...
351- * A variable number of arguments of the method.
352- * @return
353- * The return value of the method on success or FALSE. On FALSE, see
354- * xmlrpc_errno() and xmlrpc_error_msg().
355- */
356- function xmlrpc () {
343+ function _xmlrpc () {
357344 $ args = func_get_args ();
358345 $ url = array_shift ($ args );
359- $ method = array_shift ($ args );
346+ if (is_array ($ args [0 ])) {
347+ $ method = 'system.multicall ' ;
348+ $ multicall_args = array ();
349+ foreach ($ args [0 ] as $ call ) {
350+ $ multicall_args [] = array ('methodName ' => array_shift ($ call ),'params ' => $ call );
351+ }
352+ $ args = array ($ multicall_args );
353+ }
354+ else {
355+ $ method = array_shift ($ args );
356+ }
360357 $ xmlrpc_request = xmlrpc_request ($ method , $ args );
361- // $request .= "Content-Type: text/xml$r";
362358 $ result = drupal_http_request ($ url , array ("Content-Type " => "text/xml " ), 'POST ' , $ xmlrpc_request ->xml );
363359 if ($ result ->code != 200 ) {
364360 xmlrpc_error (-$ result ->code , $ result ->error );
@@ -380,30 +376,6 @@ function xmlrpc() {
380376 return $ message ->params [0 ];
381377}
382378
383- /**
384- * Perform multiple calls in one request if possible.
385- *
386- * @param $url
387- * An absolute URL of the XML-RPC server
388- * @param $calls
389- * An array of calls. Each call is an array, where the first element
390- * is the method name, further elements are the arguments.
391- * @return
392- * An array of results.
393- */
394- function xmlrpc_multicall () {
395- $ args = func_get_args ();
396- $ url = $ args [0 ];
397- foreach ($ args [1 ] as $ call ) {
398- $ method = array_shift ($ call );
399- $ calls [] = array (
400- 'methodName ' => $ method ,
401- 'params ' => $ call
402- );
403- }
404- return xmlrpc ($ url , 'system.multicall ' , $ calls );
405- }
406-
407379/**
408380 * Returns the last XML-RPC client error number
409381 */
0 commit comments