Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

An XML-RPC client

Author: Donal McMullan donal@catalyst.net.nz
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
Version: 0.0.1
File Size: 393 lines (16 kb)
Included or required:0 times
Referenced: 15 times
Includes or requires: 0 files

Defines 2 classes

mnet_xmlrpc_client:: (2 methods):
  __construct()
  mnet_xmlrpc_client()

name:: (6 methods):
  set_timeout()
  set_method()
  add_param()
  send()
  permission_to_call()
  prepare_http_request()


Class: mnet_xmlrpc_client  - X-Ref

Class representing an XMLRPC request against a remote machine

__construct()   X-Ref
Constructor


mnet_xmlrpc_client()   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

set_timeout($timeout)   X-Ref
Allow users to override the default timeout

param: int $timeout    Request timeout in seconds

set_method($xmlrpcpath)   X-Ref
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


add_param($argument, $type = 'string')   X-Ref
Add a parameter to the array of parameters.

param: string  $argument    A transport ID, as defined in lib.php
param: string  $type        The argument type, can be one of:
return: bool                 True on success

send($mnet_peer)   X-Ref
Send the request to the server - decode and return the response

param: object   $mnet_peer      A mnet_peer object with details of the
return: mixed                    A PHP variable, as returned by the

permission_to_call($mnet_peer)   X-Ref
Check that we are permitted to call method on specified peer

param: object $mnet_peer A mnet_peer object with details of the remote host we're connecting to
return: bool True if we permit calls to method on specified peer, False otherwise.

prepare_http_request($mnet_peer)   X-Ref
Generate a curl handle and prepare it for sending to an mnet host

param: object $mnet_peer A mnet_peer object with details of the remote host the request will be sent to
return: cURL handle - the almost-ready-to-send http request