Dotclear 2.24
Loading...
Searching...
No Matches
xmlrpcServer Class Reference

Basic XML-RPC Server. More...

Inheritance diagram for xmlrpcServer:
xmlrpcIntrospectionServer dcXmlRpc

Public Member Functions

 __construct ($callbacks=false, $data=false, string $encoding='UTF-8')
 
 serve ($data=false)
 

Data Fields

 $strict_check = false
 

Protected Member Functions

 head (int $code, string $msg)
 
 call (string $methodname, array $args)
 
 error (Exception $e)
 
 output (string $xml)
 
 hasMethod (string $method)
 
 setCapabilities ()
 
 setCallbacks ()
 
 getCapabilities ()
 
 listMethods ()
 
 multiCall (array $methodcalls)
 

Protected Attributes

 $callbacks = []
 
 $data
 
 $encoding
 
 $message
 
 $capabilities
 

Detailed Description

Basic XML-RPC Server.

XML-RPC Server

This class library is fully based on Simon Willison's IXR library (http://scripts.incutio.com/xmlrpc/).

This is the most basic XML-RPC server you can create. Built-in methods are:

  • system.getCapabilities
  • system.listMethods
  • system.multicall

Constructor & Destructor Documentation

◆ __construct()

__construct (   $callbacks = false,
  $data = false,
string  $encoding = 'UTF-8' 
)

Constructor

Parameters
mixed$callbacksServer callbacks
mixed$dataServer data
string$encodingServer encoding

References $callbacks, $data, $encoding, serve(), setCallbacks(), and setCapabilities().

Member Function Documentation

◆ serve()

serve (   $data = false)

Start XML-RPC Server

This method starts the XML-RPC Server. It could take a data argument which should be a valid XML-RPC raw stream. If data is not specified, it take values from raw POST data.

Parameters
mixed$dataXML-RPC raw stream

Reimplemented in dcXmlRpc.

References $data, call(), error(), exit, head(), and output().

Referenced by __construct().

◆ head()

head ( int  $code,
string  $msg 
)
protected

Send HTTP Headers

This method sends a HTTP Header

Parameters
integer$codeHTTP Status Code
string$msgHeader message

References $code.

Referenced by serve().

◆ call()

call ( string  $methodname,
array  $args 
)
protected

Method call

This method calls the given XML-RPC method with arguments.

Parameters
string$methodnameMethod name
array$argsMethod arguments
Returns
mixed

References hasMethod().

Referenced by multiCall(), and serve().

◆ error()

error ( Exception  $e)
protected

XML-RPC Error

This method create an XML-RPC error message from a PHP Exception object. You should avoid using this in your own method and throw exceptions instead.

Parameters
Exception$eException object

References output().

Referenced by serve().

◆ output()

output ( string  $xml)
protected

Output response

This method sends the whole XML-RPC response through HTTP.

Parameters
string$xmlXML Content

References exit.

Referenced by error(), and serve().

◆ hasMethod()

hasMethod ( string  $method)
protected

XML-RPC Server has method?

Returns true if the server has the given method $method

Parameters
string$methodMethod name
Returns
bool

Referenced by xmlrpcIntrospectionServer\call(), call(), and xmlrpcIntrospectionServer\methodSignature().

◆ setCapabilities()

setCapabilities ( )
protected

Server Capabilities

This method initiates the server capabilities:

  • xmlrpc
  • faults_interop
  • system.multicall

Referenced by __construct(), and xmlrpcIntrospectionServer\__construct().

◆ setCallbacks()

setCallbacks ( )
protected

Server Methods

This method creates the three main server's methods:

  • system.getCapabilities
  • system.listMethods
  • system.multicall
See also
getCapabilities()
listMethods()
multiCall()

Referenced by __construct(), and xmlrpcIntrospectionServer\__construct().

◆ getCapabilities()

getCapabilities ( )
protected

Server Capabilities

Returns server capabilities

Returns
array

References $capabilities.

◆ listMethods()

listMethods ( )
protected

Server methods

Returns all server methods

Returns
array

◆ multiCall()

multiCall ( array  $methodcalls)
protected

Multicall

This method handles a multi-methods call

See also
http://www.xmlrpc.com/discuss/msgReader$1208
Parameters
array$methodcallsArray of methods
Returns
array

References call().

Field Documentation

◆ $callbacks

$callbacks = []
protected

Referenced by __construct().

◆ $data

$data
protected

Referenced by __construct(), and serve().

◆ $encoding

$encoding
protected

◆ $message

$message
protected

◆ $capabilities

$capabilities
protected

Referenced by getCapabilities().

◆ $strict_check

$strict_check = false

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