Merge branch 'MDL-67995-37' of git://github.com/cescobedo/moodle into MOODLE_37_STABLE
[moodle.git] / webservice / upgrade.txt
blobd5b959d5c5ae5fe98920e337128043756ae94dfe
1 This files describes API changes in /webservice/*
2 information provided here is intended especially for developers.
4 This information is intended for authors of webservices, not people writing webservice clients.
6 === 3.7 ===
8 * External function core_webservice_external::get_site_info() now returns the current site theme (for the user).
10 === 3.4 ===
12 * External function core_webservice_external::get_site_info() now returns the calendar type used in the site and
13   by the user in the sitecalendartype and usercalendartype fields.
14 * Implementations of forms for test clients now must follow naming schema: WSFUNCTIONNAME_testclient_form
15   The old naming schema WSFUNCTIONNAME_form caused conflicts with existing classes.
16   New class webservice_test_client_base_form can be used as a base class for such forms.
18 === 3.2 ===
20 * webservice->get_external_functions now returns the external function list ordered by name ASC.
21 * The filearea optional parameter has been removed from webservice/upload.php.
22   Since Moodle 3.1 all the uploads go to the draft area.
23 * external_format_text() function: component, filearea and itemid are now optional parameters.
24   In some contexts those parameteres are not necessary because is not required to do a file rewrite via
25   file_rewrite_pluginfile_urls.
26 * External function get_site_info now returns the site course ID. This new field is marked as VALUE_OPTIONAL for backwards compatibility.
27 * A new field "privatetoken" has been added to the "external_tokens" table.
28   This private token must be safely stored (or not stored at all) by the client because it will be used in places where a request
29   must be double-checked.
30   This token should not be passed via GET paramaters and it must be transmitted only via https.
31   This token is generated only in login/token.php after the user credential has been confirmed. It can't be generated by admins.
33 === 3.1 ===
35 * The xmlrpc backend has changed, Zend_XmlRpc has been dropped and there might be slight differences in
36   responses. Fault strings that were generated by Zend_XmlRpc_XXX_Exception exceptions (i.e. 'Method
37   "[methodname]" does not exist') are no longer used which may display a different error message depending
38   on the string returned by the getMessage() method of the thrown exception.
39 * The xmlrpc server is no longer enabled when the Mobile service is activated.
40 * Support for the AMF protocol has been dropped completely.
41 * As Zend Framework has been removed, the webservice_zend_* classes have also been removed.
42 * Zend_SOAP has been dropped. The native PHP SoapClient and SoapServer classes are now being used instead. WSDL is now
43   generated by the new class webservice_soap_wsdl. For fault strings, a different error message might be shown depending
44   on the string returned by the getMessage() method of the thrown exception.
45 * With Zend_SOAP dropped, moodle_zend_soap_server is now also deprecated.
46 * As mentioned in the 2.9 notes, deprecated web service functions have now been removed.
47 * Since our new XML-RPC server implementation does not support introspection, it is critical that all clients send
48   parameters in the correct order.
49 * File uploading to the user private file area via the webservice/upload.php script is not supported anymore.
50   Only uploads to the draft area are allowed.
52 === 3.0 ===
54 * WS protocols webservice/myprotocol:use capabilities were defined with a high riskbitmask value
55   when the fact that a user has that capability does not imply any risk, but other capabilities
56   that the user may have do. If your ws protocol does not imply and risk by itself, you can remove the
57   riskbitmask from your $capabilities array in webservice/myprotocol/db/access.php
58 * New function for formatting external strings: external_format_strings, it should be used as a replacement of format_string in
59   external functions.
60   All the occurrences of format_strings have been replaced with this new function.
62 === 2.9 ===
64 * The deprecated functions can not be added to services anymore and
65   a debugging message for developers is triggered when viewing an existing
66   services using them. It is recommended to replace calls to the deprecated
67   functions for calls to the proposed replacements. If you are using a moodle
68   mobile app fork, it is recommended to update your customisations on top of
69   the latest moodle mobile app version.
71   The web services functions that will be finally deprecated in the next
72   moodle version are:
73     - moodle_course_create_courses
74     - moodle_course_get_courses
75     - moodle_enrol_get_enrolled_users
76     - moodle_enrol_get_users_courses
77     - moodle_enrol_manual_enrol_users
78     - moodle_file_get_files
79     - moodle_file_upload
80     - moodle_group_add_groupmembers
81     - moodle_group_create_groups
82     - moodle_group_delete_groupmembers
83     - moodle_group_delete_groups
84     - moodle_group_get_course_groups
85     - moodle_group_get_groupmembers
86     - moodle_group_get_groups
87     - moodle_message_send_instantmessages
88     - moodle_notes_create_notes
89     - moodle_role_assign
90     - moodle_role_unassign
91     - moodle_user_create_users
92     - moodle_user_delete_users
93     - moodle_user_get_course_participants_by_id
94     - moodle_user_get_users_by_courseid
95     - moodle_user_get_users_by_id
96     - moodle_user_update_users
97     - core_grade_get_definitions
98     - core_user_get_users_by_id
99     - moodle_webservice_get_siteinfo
101 * External function core_webservice_external::get_site_info now returns additional optional fields:
102    - advancedfeatures: Array listing Moodle advanced features and if enabled or not.
103    - usercanmanageownfiles: Whether the my files option is disabled.
104    - userquota: User storage quota.
105    - usermaxuploadfilesize: Files upload size limit.
108 === 2.7 ===
110 * All webservice server.php and simpleserver.php scripts must define('WS_SERVER', true)
111   before including config.php file.
114 === 2.6 ===
116 * webservice/upload.php
117 Accepts 2 new post parameters to allow uploading of files to a users draft area.
118  - filearea should be either 'private' (default) or 'draft'
119  - itemid unused if the filearea is 'private', for 'draft' it can be the id of a previously
120    created draft area - or 0 which will generate a new draft area for the files.