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

Class: XML_RPC2_Server_Callhandler_Instance

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

Class Overview

XML_RPC2_Server_CallHandler
   |
   --XML_RPC2_Server_Callhandler_Instance

This class is a server call handler which exposes an instance's public methods.


Author(s):

Copyright:

  • 2004-2006 Sergio Carvalho

Methods


Inherited Variables

Inherited Methods


Class Details

[line 88]
This class is a server call handler which exposes an instance's public methods.

XML_RPC2_Server_Callhandler_Instance is the preferred call handler to use when you just need to quickly expose an already existing object. If designing a remote API from the ground up, it's best to use XML_RPC2_Server_Callhandler_Class instead.

Usage is simple:

  • PhpDoc the 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.  class EchoServer {
  2.      /**
  3.       * Echo the message
  4.       *
  5.       * @param string The string to echo
  6.       * @return string The echo
  7.      */
  8.      public function echoecho($string)
  9.      {
  10.          return $string;
  11.      }
  12.  }
  13.  
  14.  require_once 'XML/RPC2/Server.php';
  15.  $someInstance = new EchoServer();
  16.  $server XML_RPC2_Server::create($someInstance);
  17.  $server->handleCall();



[ Top ]


Method Detail

__construct (Constructor)   [line 113]

XML_RPC2_Server_Callhandler_Instance __construct( object The $instance, string $defaultPrefix)

XML_RPC2_Server_Callhandler_Class Constructor. Creates a new call handler exporting the given object 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.


Parameters:

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

[ Top ]

__call   [line 136]

mixed __call( string $methodName, array $parameters)

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

Parameters:

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

[ Top ]


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