Remove the old xmlrpc() wrapper and replace it with drupal_function_exists().

From: Damien Tournoud <damien@tournoud.net>


---
 common.inc                   |   28 ----------------------------
 xmlrpc.inc                   |   23 +++++++++++++++++++----
 blogapi/blogapi.test         |    3 +++
 simpletest/tests/xmlrpc.test |    6 ++++++
 4 files changed, 28 insertions(+), 32 deletions(-)

diff --git includes/common.inc includes/common.inc
index c2817a7..61e370e 100644
--- includes/common.inc
+++ includes/common.inc
@@ -2958,34 +2958,6 @@ function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
   return (($skip_anonymous && $user->uid == 0) || ($token == md5(session_id() . $value . variable_get('drupal_private_key', ''))));
 }
 
-/**
- * Performs one or more XML-RPC request(s).
- *
- * @param $url
- *   An absolute URL of the XML-RPC endpoint.
- *     Example:
- *     http://www.example.com/xmlrpc.php
- * @param ...
- *   For one request:
- *     The method name followed by a variable number of arguments to the method.
- *   For multiple requests (system.multicall):
- *     An array of call arrays. Each call array follows the pattern of the single
- *     request: method name followed by the arguments to the method.
- * @return
- *   For one request:
- *     Either the return value of the method on success, or FALSE.
- *     If FALSE is returned, see xmlrpc_errno() and xmlrpc_error_msg().
- *   For multiple requests:
- *     An array of results. Each result will either be the result
- *     returned by the method called, or an xmlrpc_error object if the call
- *     failed. See xmlrpc_error().
- */
-function xmlrpc($url) {
-  require_once DRUPAL_ROOT . '/includes/xmlrpc.inc';
-  $args = func_get_args();
-  return call_user_func_array('_xmlrpc', $args);
-}
-
 function _drupal_bootstrap_full() {
   static $called;
 
diff --git includes/xmlrpc.inc includes/xmlrpc.inc
index 0f39439..875530a 100644
--- includes/xmlrpc.inc
+++ includes/xmlrpc.inc
@@ -417,13 +417,28 @@ function xmlrpc_base64_get_xml($xmlrpc_base64) {
 }
 
 /**
- * Execute an XML remote procedural call. This is private function; call xmlrpc()
- * in common.inc instead of this function.
+ * Performs one or more XML-RPC request(s).
  *
+ * @param $url
+ *   An absolute URL of the XML-RPC endpoint.
+ *     Example:
+ *     http://www.example.com/xmlrpc.php
+ * @param ...
+ *   For one request:
+ *     The method name followed by a variable number of arguments to the method.
+ *   For multiple requests (system.multicall):
+ *     An array of call arrays. Each call array follows the pattern of the single
+ *     request: method name followed by the arguments to the method.
  * @return
- *   A $xmlrpc_message object if the call succeeded; FALSE if the call failed
+ *   For one request:
+ *     Either the return value of the method on success, or FALSE.
+ *     If FALSE is returned, see xmlrpc_errno() and xmlrpc_error_msg().
+ *   For multiple requests:
+ *     An array of results. Each result will either be the result
+ *     returned by the method called, or an xmlrpc_error object if the call
+ *     failed. See xmlrpc_error().
  */
-function _xmlrpc() {
+function xmlrpc() {
   $args = func_get_args();
   $url = array_shift($args);
   if (is_array($args[0])) {
diff --git modules/blogapi/blogapi.test modules/blogapi/blogapi.test
index dc09289..c4cdf88 100644
--- modules/blogapi/blogapi.test
+++ modules/blogapi/blogapi.test
@@ -12,6 +12,9 @@ class BlogAPITestCase extends DrupalWebTestCase {
 
   function setUp() {
     parent::setUp('blog', 'blogapi', 'taxonomy');
+
+    // Force loading the xmlrpc.inc to have the xmlrpc() function.
+    drupal_function_exists('xmlrpc');
   }
 
   /**
diff --git modules/simpletest/tests/xmlrpc.test modules/simpletest/tests/xmlrpc.test
index 7147fdb..d2e9a90 100644
--- modules/simpletest/tests/xmlrpc.test
+++ modules/simpletest/tests/xmlrpc.test
@@ -12,6 +12,9 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase {
 
   function setUp() {
     parent::setUp('xmlrpc_test');
+
+    // Force loading the xmlrpc.inc to have the xmlrpc() function.
+    drupal_function_exists('xmlrpc');
   }
 
   /**
@@ -132,6 +135,9 @@ class XMLRPCMessagesTestCase extends DrupalWebTestCase {
 
   function setUp() {
     parent::setUp('xmlrpc_test');
+
+    // Force loading the xmlrpc.inc to have the xmlrpc() function.
+    drupal_function_exists('xmlrpc');
   }
 
   /**
