Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
mnet_xmlrpc_client Class Reference

Class representing an XMLRPC request against a remote machine. More...

Public Member Functions

 __construct ()
 Constructor.
 
 add_param ($argument, $type='string')
 Add a parameter to the array of parameters.
 
 permission_to_call ($mnet_peer)
 Check that we are permitted to call method on specified peer.
 
 prepare_http_request ($mnet_peer)
 Generate a PhpXmlRpc\Client handle and prepare it for sending to an mnet host.
 
 send ($mnet_peer, bool $rekey=false)
 Send the request to the server - decode and return the response.
 
 set_method ($xmlrpcpath)
 Set the path to the method or function we want to execute on the remote machine.
 
 set_timeout ($timeout)
 Allow users to override the default timeout.
 

Public Attributes

 $error = array()
 
 $method = ''
 
 $mnet = null
 
 $params = array()
 
 $response = ''
 
 $timeout = 60
 

Detailed Description

Class representing an XMLRPC request against a remote machine.

Member Function Documentation

◆ add_param()

mnet_xmlrpc_client::add_param ( $argument,
$type = 'string' )

Add a parameter to the array of parameters.

Parameters
string$argumentA transport ID, as defined in lib.php
string$typeThe argument type, can be one of: i4 i8 int double string boolean datetime | dateTime.iso8601 base64 null array struct
Return values
boolTrue on success

◆ permission_to_call()

mnet_xmlrpc_client::permission_to_call ( $mnet_peer)

Check that we are permitted to call method on specified peer.

Parameters
object$mnet_peerA mnet_peer object with details of the remote host we're connecting to
Return values
boolTrue if we permit calls to method on specified peer, False otherwise.

◆ prepare_http_request()

mnet_xmlrpc_client::prepare_http_request ( $mnet_peer)

Generate a PhpXmlRpc\Client handle and prepare it for sending to an mnet host.

Parameters
object$mnet_peerA mnet_peer object with details of the remote host the request will be sent to
Return values
PhpXmlRpc\Clienthandle - the almost-ready-to-send http request

◆ send()

mnet_xmlrpc_client::send ( $mnet_peer,
bool $rekey = false )

Send the request to the server - decode and return the response.

Parameters
object$mnet_peerA mnet_peer object with details of the remote host we're connecting to
bool$rekeyThe rekey attribute stops us from getting into a loop.
Return values
mixedA PHP variable, as returned by the

◆ set_method()

mnet_xmlrpc_client::set_method ( $xmlrpcpath)

Set the path to the method or function we want to execute on the remote machine.

Examples: mod/scorm/functionname auth/mnet/methodname In the case of auth and enrolment plugins, an object will be created and the method on that object will be called

◆ set_timeout()

mnet_xmlrpc_client::set_timeout ( $timeout)

Allow users to override the default timeout.

Parameters
int$timeoutRequest timeout in seconds $return bool True if param is an integer or integer string

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