ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
XML_RPC2_Backend Class Reference
+ Collaboration diagram for XML_RPC2_Backend:

Static Public Member Functions

static setBackend ($backend)
 Backend setter. More...
 
static getServerClassname ()
 Include the relevant php files for the server class, and return the backend server class name. More...
 
static getClientClassname ()
 Include the relevant php files for the client class, and return the backend client class name. More...
 
static getValueClassname ()
 Include the relevant php files for the value class, and return the backend value class name. More...
 

Static Protected Member Functions

static getBackend ()
 Backend getter. More...
 

Static Protected Attributes

static $currentBackend
 

Detailed Description

Definition at line 70 of file Backend.php.

Member Function Documentation

◆ getBackend()

static XML_RPC2_Backend::getBackend ( )
staticprotected

Backend getter.

Return the current backend name. If no backend was previously selected select one and set it.

The xmlrpcext backend is preferred, and will be automatically selected when no explicit backend has been set and the xmlrpc extension exists. If it does not exist, then the php backend is selected.

Returns
string The current backend

Definition at line 135 of file Backend.php.

136  {
137  if (!isset(self::$currentBackend)) {
138  try {
139  self::setBackend('XMLRPCext'); // We prefer this one
140  } catch (XML_RPC2_Exception $e) {
141  // TODO According to PEAR CG logging should occur here
142  self::setBackend('php'); // But will settle with this one in case of error
143  }
144  }
145  return self::$currentBackend;
146  }

◆ getClientClassname()

static XML_RPC2_Backend::getClientClassname ( )
static

Include the relevant php files for the client class, and return the backend client class name.

Returns
string The Client class name

Definition at line 171 of file Backend.php.

Referenced by XML_RPC2_Client\create().

171  {
172  require_once(sprintf('XML/RPC2/Backend/%s/Client.php', self::getBackend()));
173  return sprintf('XML_RPC2_Backend_%s_Client', self::getBackend());
174  }
+ Here is the caller graph for this function:

◆ getServerClassname()

static XML_RPC2_Backend::getServerClassname ( )
static

Include the relevant php files for the server class, and return the backend server class name.

Returns
string The Server class name

Definition at line 157 of file Backend.php.

Referenced by XML_RPC2_Server\create().

157  {
158  require_once(sprintf('XML/RPC2/Backend/%s/Server.php', self::getBackend()));
159  return sprintf('XML_RPC2_Backend_%s_Server', self::getBackend());
160  }
+ Here is the caller graph for this function:

◆ getValueClassname()

static XML_RPC2_Backend::getValueClassname ( )
static

Include the relevant php files for the value class, and return the backend value class name.

Returns
string The Value class name

Definition at line 185 of file Backend.php.

Referenced by XML_RPC2_Value\createFromNative().

185  {
186  require_once(sprintf('XML/RPC2/Backend/%s/Value.php', self::getBackend()));
187  return sprintf('XML_RPC2_Backend_%s_Value', self::getBackend());
188  }
+ Here is the caller graph for this function:

◆ setBackend()

static XML_RPC2_Backend::setBackend (   $backend)
static

Backend setter.

Currently, two backends exist: 'php' and 'XMLRPCext'. The PHP backend has no external dependencies, while the xmlrpcext requires the xmlrpc extension.

The XMLRPCext backend is quite faster, and will be automatically selected when no explicit backend has been set and the extension is available.

Parameters
stringThe backend to select. Either 'php' or 'XMLRPCext'.

Definition at line 98 of file Backend.php.

Referenced by XML_RPC2_Server\create(), and XML_RPC2_Client\create().

99  {
100  $backend = ucfirst(strtolower($backend));
101  if (
102  $backend != 'Php' &&
103  $backend != 'Xmlrpcext'
104  ) {
105  throw new XML_RPC2_Exception(sprintf('Backend %s does not exist', $backend));
106  }
107  if (
108  $backend == 'Xmlrpcext' &&
109  !function_exists('xmlrpc_server_create') &&
110  !( // TODO Use PEAR::loadExtension once PEAR passes PHP5 unit tests (E_STRICT compliance, namely)
111  @dl('php_xmlrpc' . PHP_SHLIB_SUFFIX) || @dl('xmlrpc' . PHP_SHLIB_SUFFIX)
112  )
113  ) {
114  throw new XML_RPC2_Exception('Unable to load xmlrpc extension.');
115  }
116  self::$currentBackend = $backend;
117  }
+ Here is the caller graph for this function:

Field Documentation

◆ $currentBackend

XML_RPC2_Backend::$currentBackend
staticprotected

Definition at line 80 of file Backend.php.


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