[ class tree: XML_RPC2 ] [ index: XML_RPC2 ] [ all elements ]

Class: XML_RPC2_Server_Callhandler_Class

Source Location: /XML_RPC2-1.1.2/XML/RPC2/Server/CallHandler/Class.php

Class Overview


This class is a server call handler which exposes a classe's static public methods.



  • 2004-2006 Sergio Carvalho


Inherited Variables

Inherited Methods

Class Details

[line 90]
This class is a server call handler which exposes a classe's static public methods.

XML_RPC2_Server_Callhandler_Class is the preferred call handler to use when you are designing your XML-RPC server from the ground up. Usage is quite simple:

  • Create a class holding all of the XML-RPC server's exported procedures as public static methods (the interface class).
  • PhpDoc the classes' methods, including at least method signature (params and return types) and short description.
  • Use the XML_RPC2 factory method to create a server based on the interface class.
A simple example:
  1.  /**
  2.   * echoecho echoes the message received
  3.   *
  4.   * @param string  Message
  5.   * @return string The echo
  6.   */
  7.  class EchoServer {
  8.      public static function echoecho($string)
  9.      {
  10.          return $string;
  11.      }
  12.  }
  14.  require_once 'XML/RPC2/Server.php';
  15.  $server XML_RPC2_Server::create('EchoServer');
  16.  $server->handleCall();

Use this call handler if you have designed your xml-rpc external interface as a set of public class methods on a given class. If, on the other hand, you intend to export an already existing class, it may be that not all of the methods you want to export are static. In that case, it is probably best to use XML_RPC2_Server_Callhandler_Instance instead.

[ Top ]

Method Detail

__construct (Constructor)   [line 115]

XML_RPC2_Server_Callhandler_Class __construct( string $className, string $defaultPrefix)

XML_RPC2_Server_Callhandler_Class Constructor. Creates a new call handler exporting the give static class' methods

Before using this constructor, take a look at XML_RPC2_Server::create. The factory method is usually a quicker way of instantiating the server and its call handler.


string   $className   —  The Target class. Calls will be made on this class
string   $defaultPrefix   —  Default prefix to prepend to all exported methods (defaults to '')

[ Top ]

__call   [line 138]

mixed __call( string $methodName, array $parameters)

__call catchall. Delegate the method call to the target class, and return its result
  • Return: Whatever the target method returned
  • Access: public


string   $methodName   —  Name of method to call
array   $parameters   —  Array of parameters for call

[ Top ]

Documentation generated on Mon, 11 Mar 2019 15:56:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.