## Class ripcord

Description

The ripcord class contains a number of useful static methods. This makes it a bit easier to create a server or client, convert types and check for errors.

Located in /ripcord.php (line 16)

Class Constant Summary
cannotAccessURL = -4
cannotRecurse = -3
methodNotFound = -1
notBase64 = -7
notDatetime = -6
notRipcordCall = -2
unknownServiceType = -8
xmlrpcNotInstalled = -5
Method Summary
static object base64 (string $binary)
static string binary (object $base64)
static void client (string $url, [array $options = null], [ $transport = null])
static object datetime (int $timestamp)
static void documentor ([array $options = null], [object docCommentParser $docCommentParser = null])
static object encodeCall (string $method, mixed $args,...)
static array fault (int $code, string $message)
static string getType (mixed $param)
static bool isFault (mixed $fault)
static boolean load (string $class)
static void server ([mixed $services = null], [array $options = null], [ $documentor = null])
static object simpleClient (string $url, [array $options = null])
static void soapClient (string $url, [array $options = null])
static int timestamp (object $datetime)
static object xmlrpcClient (string $url, [array $options = null])
void bind ( &$bound, $call)
Methods
static method base64 (line 139)

This method returns an XML-RPC base64 object from a given binary string.

- access: public

static object base64 (string $binary)

- string $binary

static method binary (line 152)

This method returns a (binary) string from a given XML-RPC base64 object.

It will throw a 'Variable is not of type base64' Ripcord_Exception (code -7) if the given argument is not of the correct type.

- access: public

static string binary (object $base64)

- object $base64

static method client (line 79)

This method returns a new Ripcord client. By default this will be an XML-RPC client, but you can change this through the $options argument.

- see: Ripcord_Client
- access: public

static void client (string $url, [array $options = null], [ $transport = null])

- string $url: The url of the RPC server to connect with
- array $options: Optional. An array of options to set for the Ripcord client.
- $transport

static method datetime (line 110)

This method returns an XML-RPC datetime object from a given unix timestamp.

- access: public

static object datetime (int $timestamp)

- int $timestamp

static method documentor (line 96)

This method returns a new Ripcord documentor object.

- see: Ripcord_Client
- access: public

static void documentor ([array $options = null], [object docCommentParser $docCommentParser = null])

- array $options: Optional. An array of options to set for the Ripcord documentor.
- object docCommentParser $docCommentParser: Optional. An object that parses a docComment block. Must implement the Ripcord_Documentor_CommentParser interface.

static method encodeCall (line 246)

This method creates a new Ripcord_Client_Call object, which encodes the information needed for a method call to an rpc server. This is mostly used for the system.multiCall method.

- access: public

static object encodeCall (string $method, mixed $args,...)

- string $method: The name of the method call to encode
- mixed $args,...: The remainder of the arguments are encoded as parameters to the call

static method fault (line 38)

This method generates an XML-RPC fault with the given code and message.

- access: public

static array fault (int $code, string $message)

- int $code
- string $message

static method getType (line 168)

This method returns the type of the given parameter. This can be any of the XML-RPC data types, e.g.

'struct', 'int', 'string', 'base64', 'boolean', 'double', 'array' or 'datetime'.

- access: public

static string getType (mixed $param)

- mixed $param

static method isFault (line 23)

This method checks whether the given argument is an XML-RPC fault.

- access: public

static bool isFault (mixed $fault)

- mixed $fault

static method load (line 216)

This method includes a ripcord class, using require_once. Used for autoloading ripcord classes.

- access: public

static boolean load (string $class)

- string $class: The name of the class to load.

static method server (line 51)

This method returns a new Ripcord server, which by default implements XML-RPC, Simple RPC and SOAP 1.1.

The server will publish any methods passed through the $services argument. It can be configured through the $options argument.

- see: Ripcord_Server
- access: public

static void server ([mixed $services = null], [array $options = null], [ $documentor = null])

- mixed $services: Optional. Either an object or an array of objects. If the array has non-numeric keys, the key will be used as a namespace for the methods in the object.
- array $options: Optional. An array of options to set for the Ripcord server.
- $documentor

static method simpleClient (line 205)

This method returns a new Ripcord client, configured to access a Simple RPC server.

- see: Ripcord_Client
- access: public

static object simpleClient (string $url, [array $options = null])

- string $url
- array $options: Optional.

static method soapClient (line 179)

This method returns a new Ripcord client, configured to access a SOAP 1.1 server.

- see: Ripcord_Client
- access: public

static void soapClient (string $url, [array $options = null])

- string $url
- array $options: Optional.

static method timestamp (line 124)

This method returns a unix timestamp from a given XML-RPC datetime object.

It will throw a 'Variable is not of type datetime' Ripcord_Exception (code -6) if the given argument is not of the correct type.

- access: public

static int timestamp (object $datetime)

- object $datetime

static method xmlrpcClient (line 192)

This method returns a new Ripcord client, configured to access an XML-RPC server.

- see: Ripcord_Client
- access: public

static object xmlrpcClient (string $url, [array $options = null])

- string $url
- array $options: Optional.

bind (line 263)

- access: public

void bind ( &$bound, $call)

- &$bound
- $call

Class Constants
cannotAccessURL = -4 (line 289)

Could not access {url} - Thrown by the transport object when unable to access the given url.

cannotRecurse = -3 (line 285)

Cannot recurse system.multiCall - Thrown by the ripcord server when system.multicall is called within itself.

methodNotFound = -1 (line 277)

Method {method} not found. - Thrown by the ripcord server when a requested method isn't found.

notBase64 = -7 (line 301)

Variable is not of type base64 - Thrown by the ripcord binary method.

notDatetime = -6 (line 297)

Variable is not of type datetime - Thrown by the ripcord timestamp method.

notRipcordCall = -2 (line 281)

Argument {index} is not a valid Ripcord call - Thrown by the client when passing incorrect arguments to system.multiCall.

unknownServiceType = -8 (line 305)

Variable is not a classname or an object - Thrown by the ripcord server.

xmlrpcNotInstalled = -5 (line 293)

PHP XMLRPC library is not installed - Thrown by the ripcord server and client when the xmlrpc library is not installed.

Documentation generated on Tue, 16 Nov 2010 16:20:15 +0100 by phpDocumentor 1.4.3