You are here

function xmlrpc_server_method_signature in Drupal 7

Same name and namespace in other branches
  1. 4 includes/xmlrpcs.inc \xmlrpc_server_method_signature()
  2. 5 includes/xmlrpcs.inc \xmlrpc_server_method_signature()
  3. 6 includes/xmlrpcs.inc \xmlrpc_server_method_signature()

Returns one method signature for a function.

This is the function mapped to the XML-RPC method system.methodSignature.

A method signature is an array of the input and output types of a method. For instance, the method signature of this function is array('array', 'string'), because it takes an array and returns a string.

Parameters

string $methodname: Name of method to return a method signature for.

Return value

array An array of arrays of types, each of the arrays representing one method signature of the function that $methodname maps to.

1 string reference to 'xmlrpc_server_method_signature'
xmlrpc_server in includes/xmlrpcs.inc
Invokes XML-RPC methods on this server.

File

includes/xmlrpcs.inc, line 364
Provides API for defining and handling XML-RPC requests.

Code

function xmlrpc_server_method_signature($methodname) {
  $xmlrpc_server = xmlrpc_server_get();
  if (!isset($xmlrpc_server->callbacks[$methodname])) {
    return xmlrpc_error(-32601, t('Server error. Requested method @methodname not specified.', array(
      "@methodname" => $methodname,
    )));
  }
  if (!is_array($xmlrpc_server->signatures[$methodname])) {
    return xmlrpc_error(-32601, t('Server error. Requested method @methodname signature not specified.', array(
      "@methodname" => $methodname,
    )));
  }

  // We array of types
  $return = array();
  foreach ($xmlrpc_server->signatures[$methodname] as $type) {
    $return[] = $type;
  }
  return array(
    $return,
  );
}