Mercurial > defr > drupal > core
comparison includes/xmlrpc.inc @ 11:589fb7c02327 6.5
Drupal 6.5
| author | Franck Deroche <webmaster@defr.org> |
|---|---|
| date | Tue, 23 Dec 2008 14:32:19 +0100 |
| parents | fff6d4c8c043 |
| children | 8b6c45761e01 |
comparison
equal
deleted
inserted
replaced
| 10:6f15c9d74937 | 11:589fb7c02327 |
|---|---|
| 1 <?php | 1 <?php |
| 2 // $Id: xmlrpc.inc,v 1.47.2.2 2008/04/14 18:01:19 dries Exp $ | 2 // $Id: xmlrpc.inc,v 1.47.2.3 2008/09/17 06:28:54 goba Exp $ |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * @file | 5 * @file |
| 6 * Drupal XML-RPC library. Based on the IXR - The Incutio XML-RPC Library - (c) Incutio Ltd 2002-2005 | 6 * Drupal XML-RPC library. Based on the IXR - The Incutio XML-RPC Library - (c) Incutio Ltd 2002-2005 |
| 7 * Version 1.7 (beta) - Simon Willison, 23rd May 2005 | 7 * Version 1.7 (beta) - Simon Willison, 23rd May 2005 |
| 340 $xmlrpc_request->xml .= '</params></methodCall>'; | 340 $xmlrpc_request->xml .= '</params></methodCall>'; |
| 341 return $xmlrpc_request; | 341 return $xmlrpc_request; |
| 342 } | 342 } |
| 343 | 343 |
| 344 | 344 |
| 345 function xmlrpc_error($code = NULL, $message = NULL) { | 345 function xmlrpc_error($code = NULL, $message = NULL, $reset = FALSE) { |
| 346 static $xmlrpc_error; | 346 static $xmlrpc_error; |
| 347 if (isset($code)) { | 347 if (isset($code)) { |
| 348 $xmlrpc_error = new stdClass(); | 348 $xmlrpc_error = new stdClass(); |
| 349 $xmlrpc_error->is_error = TRUE; | 349 $xmlrpc_error->is_error = TRUE; |
| 350 $xmlrpc_error->code = $code; | 350 $xmlrpc_error->code = $code; |
| 351 $xmlrpc_error->message = $message; | 351 $xmlrpc_error->message = $message; |
| 352 module_invoke('system', 'check_http_request'); | 352 module_invoke('system', 'check_http_request'); |
| 353 } | |
| 354 elseif ($reset) { | |
| 355 $xmlrpc_error = NULL; | |
| 353 } | 356 } |
| 354 return $xmlrpc_error; | 357 return $xmlrpc_error; |
| 355 } | 358 } |
| 356 | 359 |
| 357 function xmlrpc_error_get_xml($xmlrpc_error) { | 360 function xmlrpc_error_get_xml($xmlrpc_error) { |
| 425 * A $xmlrpc_message object if the call succeeded; FALSE if the call failed | 428 * A $xmlrpc_message object if the call succeeded; FALSE if the call failed |
| 426 */ | 429 */ |
| 427 function _xmlrpc() { | 430 function _xmlrpc() { |
| 428 $args = func_get_args(); | 431 $args = func_get_args(); |
| 429 $url = array_shift($args); | 432 $url = array_shift($args); |
| 433 xmlrpc_clear_error(); | |
| 430 if (is_array($args[0])) { | 434 if (is_array($args[0])) { |
| 431 $method = 'system.multicall'; | 435 $method = 'system.multicall'; |
| 432 $multicall_args = array(); | 436 $multicall_args = array(); |
| 433 foreach ($args[0] as $call) { | 437 foreach ($args[0] as $call) { |
| 434 $multicall_args[] = array('methodName' => array_shift($call), 'params' => $call); | 438 $multicall_args[] = array('methodName' => array_shift($call), 'params' => $call); |
| 473 */ | 477 */ |
| 474 function xmlrpc_error_msg() { | 478 function xmlrpc_error_msg() { |
| 475 $error = xmlrpc_error(); | 479 $error = xmlrpc_error(); |
| 476 return ($error != NULL ? $error->message : NULL); | 480 return ($error != NULL ? $error->message : NULL); |
| 477 } | 481 } |
| 482 | |
| 483 /** | |
| 484 * Clears any previous error. | |
| 485 */ | |
| 486 function xmlrpc_clear_error() { | |
| 487 xmlrpc_error(NULL, NULL, TRUE); | |
| 488 } |
