dirroot.'/webservice/lib.php'); /* * Rest server class */ final class rest_server extends webservice_server { public function __construct() { $this->set_protocolname("Rest"); $this->set_protocolid("rest"); } /** * Run REST server */ public function run() { $enable = $this->get_enable(); if (empty($enable)) { die; } require_once('locallib.php'); //retrieve path and function name from the URL $rest_arguments = get_file_argument('server.php'); header ("Content-type: text/xml"); echo call_moodle_function($rest_arguments); } } ?>