<?php
-include_once("includes/xmlrpcs.inc");
-include_once "includes/common.inc";
+/**
+ * @file
+ * PHP page for handling incoming XML-RPC requests from clients.
+ */
-$functions = array();
+/**
+ * Root directory of Drupal installation.
+ */
+define('DRUPAL_ROOT', getcwd());
-foreach (module_list() as $name) {
- if (module_hook($name, "xmlrpc")) {
- $functions = array_merge($functions, module_invoke($name, "xmlrpc"));
- }
-}
+include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+include_once DRUPAL_ROOT . '/includes/xmlrpc.inc';
+include_once DRUPAL_ROOT . '/includes/xmlrpcs.inc';
-$server = new xmlrpc_server($functions);
-
-?>
+xmlrpc_server(module_invoke_all('xmlrpc'));