Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

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: 394 lines (16 kb)
Included or required:0 times
Referenced: 3 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