Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 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: 394 lines (16 kb)
Included or required:0 times
Referenced: 0 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.

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

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

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

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

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

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

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