MDL-32581 support additional format field with all text field in extrnal lib function + new possible ws params to decide how format is returned (which are stored in a singleton)

This commit is contained in:
Jerome Mouneyrac 2012-05-31 12:31:27 +08:00
parent 4631e39533
commit 93ce0e8296
11 changed files with 382 additions and 88 deletions

View file

@ -42,16 +42,7 @@ if (!webservice_protocol_is_enabled('rest')) {
die;
}
$restformat = optional_param('moodlewsrestformat', 'xml', PARAM_ALPHA);
//remove the alt from the request
if(isset($_GET['moodlewsrestformat'])) {
unset($_GET['moodlewsrestformat']);
}
if(isset($_POST['moodlewsrestformat'])) {
unset($_POST['moodlewsrestformat']);
}
$server = new webservice_rest_server(WEBSERVICE_AUTHMETHOD_PERMANENT_TOKEN, $restformat);
$server = new webservice_rest_server(WEBSERVICE_AUTHMETHOD_PERMANENT_TOKEN);
$server->run();
die;