CI_Xmlrpc

class CI_Xmlrpc

initialize([$config = array()])
Parameters:
  • $config (array) – Configuration data
Return type:

void

Initializes the XML-RPC library. Accepts an associative array containing your settings.

server($url[, $port = 80[, $proxy = FALSE[, $proxy_port = 8080]]])
Parameters:
  • $url (string) – XML-RPC server URL
  • $port (int) – Server port
  • $proxy (string) – Optional proxy
  • $proxy_port (int) – Proxy listening port
Return type:

void

Sets the URL and port number of the server to which a request is to be sent:

$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);

Basic HTTP authentication is also supported, simply add it to the server URL:

$this->xmlrpc->server('http://user:[email protected]/', 80);
timeout($seconds = 5)
Parameters:
  • $seconds (int) – Timeout in seconds
Return type:

void

Set a time out period (in seconds) after which the request will be canceled:

$this->xmlrpc->timeout(6);
method($function)
Parameters:
  • $function (string) – Method name
Return type:

void

Sets the method that will be requested from the XML-RPC server:

$this->xmlrpc->method('method');

Where method is the name of the method.

request($incoming)
Parameters:
  • $incoming (array) – Request data
Return type:

void

Takes an array of data and builds request to be sent to XML-RPC server:

$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
$this->xmlrpc->request($request);
send_request()
Returns: TRUE on success, FALSE on failure
Return type: bool

The request sending method. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

display_error()
Returns: Error message string
Return type: string

Returns an error message as a string if your request failed for some reason.

echo $this->xmlrpc->display_error();
display_response()
Returns: Response
Return type: mixed

Returns the response from the remote server once request is received. The response will typically be an associative array.

$this->xmlrpc->display_response();
send_error_message($number, $message)
Parameters:
  • $number (int) – Error number
  • $message (string) – Error message
Returns:

XML_RPC_Response instance

Return type:

XML_RPC_Response

This method lets you send an error message from your server to the client. First parameter is the error number while the second parameter is the error message.

return $this->xmlrpc->send_error_message(123, 'Requested data not available');
doc_CodeIgniter
2016-10-15 16:32:06
Comments
Leave a Comment

Please login to continue.