Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
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. More...
 
 mnet_xmlrpc_client ()
 Old syntax of class constructor. More...
 
 permission_to_call ($mnet_peer)
 Check that we are permitted to call method on specified peer. More...
 
 prepare_http_request ($mnet_peer)
 Generate a curl handle and prepare it for sending to an mnet host. More...
 
 send ($mnet_peer)
 Send the request to the server - decode and return the response. More...
 
 set_method ($xmlrpcpath)
 Set the path to the method or function we want to execute on the remote machine. More...
 
 set_timeout ($timeout)
 Allow users to override the default timeout. More...
 

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: none empty base64 boolean datetime double int string array struct In its weakly-typed wisdom, PHP will (currently) ignore everything except datetime and base64
Return values
boolTrue on success

◆ mnet_xmlrpc_client()

mnet_xmlrpc_client::mnet_xmlrpc_client ( )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ 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 curl 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
cURLhandle - the almost-ready-to-send http request

◆ send()

mnet_xmlrpc_client::send (   $mnet_peer)

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
Return values
mixedA PHP variable, as returned by the remote function

◆ 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: