ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
XML_RPC2_Server_Callhandler_Class Class Reference
+ Inheritance diagram for XML_RPC2_Server_Callhandler_Class:
+ Collaboration diagram for XML_RPC2_Server_Callhandler_Class:

Public Member Functions

 __construct ($className, $defaultPrefix)
 XML_RPC2_Server_Callhandler_Class Constructor. More...
 
 __call ($methodName, $parameters)
 __call catchall. More...
 
- Public Member Functions inherited from XML_RPC2_Server_CallHandler
 getMethods ()
 methods getter More...
 
 getMethod ($name)
 method getter More...
 

Private Attributes

 $_className
 

Additional Inherited Members

- Protected Member Functions inherited from XML_RPC2_Server_CallHandler
 addMethod (XML_RPC2_Server_Method $method)
 method appender More...
 
- Protected Attributes inherited from XML_RPC2_Server_CallHandler
 $methods = array()
 

Detailed Description

Definition at line 90 of file Class.php.

Constructor & Destructor Documentation

◆ __construct()

XML_RPC2_Server_Callhandler_Class::__construct (   $className,
  $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.

See also
XML_RPC2_Server::create()
Parameters
stringThe Target class. Calls will be made on this class
stringDefault prefix to prepend to all exported methods (defaults to '')

Definition at line 115 of file Class.php.

References XML_RPC2_Server_CallHandler\addMethod().

116  {
117  $this->_className = $className;
118  $reflection = new ReflectionClass($className);
119  foreach ($reflection->getMethods() as $method) {
120  if ($method->isStatic() && $method->isPublic() && !$method->isAbstract() && !$method->isConstructor())
121  {
122  $candidate = new XML_RPC2_Server_Method($method, $defaultPrefix);
123  if (!$candidate->isHidden()) $this->addMethod($candidate);
124  }
125  }
126  }
addMethod(XML_RPC2_Server_Method $method)
method appender
+ Here is the call graph for this function:

Member Function Documentation

◆ __call()

XML_RPC2_Server_Callhandler_Class::__call (   $methodName,
  $parameters 
)

__call catchall.

Delegate the method call to the target class, and return its result

Parameters
stringName of method to call
arrayArray of parameters for call
Returns
mixed Whatever the target method returned

Definition at line 138 of file Class.php.

References XML_RPC2_Server_CallHandler\getMethod(), and XML_RPC2_Server_CallHandler\getMethods().

139  {
140  if (!array_key_exists($methodName, $this->getMethods())) {
141  throw new XML_RPC2_UnknownMethodException("Method $methodName is not exported by this server");
142  }
143  return call_user_func_array(array($this->_className, $this->getMethod($methodName)->getInternalMethod()), $parameters);
144  }
getMethod($name)
method getter
getMethods()
methods getter
Definition: CallHandler.php:90
+ Here is the call graph for this function:

Field Documentation

◆ $_className

XML_RPC2_Server_Callhandler_Class::$_className
private

Definition at line 100 of file Class.php.


The documentation for this class was generated from the following file: