-
Bug
-
Resolution: Fixed
-
Minor
-
3.1
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
MDL-54032-master -
Right now we have two different rules for 'core functions' and 'plugin functions' defined for the mobile service.
I really dislike this because having two different rules means we have to explain the two ways to developers (or integrators like myself). The core stuff is already defined in core. We should just stop using the functions array in $services, and instead define them as part of the mobile service in their own function definition.
To try and explain what I mean in core, I would like to do this:
diff --git a/lib/db/services.php b/lib/db/services.php
|
index 566617a..a8610ea 100644
|
--- a/lib/db/services.php
|
+++ b/lib/db/services.php
|
@@ -348,6 +348,7 @@ $functions = array(
|
'description' => 'browse moodle files',
|
'type' => 'read',
|
'classpath' => 'files/externallib.php',
|
+ 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
|
),
|
|
'moodle_file_upload' => array(
|
@@ -1112,7 +1113,6 @@ $services = array(
|
'mod_forum_get_forums_by_courses',
|
'mod_forum_get_forum_discussions_paginated',
|
'mod_forum_get_forum_discussion_posts',
|
- 'core_files_get_files',
|
'core_message_get_messages',
|
'core_message_create_contacts',
|
'core_message_delete_contacts',
|
Until we end up with nothing in that bottom 'central' services array.
The benefit is then that there aren't two rules for people to learn for how to add a function to the mobile service.. and we won't get mistakes like we already have in that old functions array:
'enrol_guest_get_instance_info',
|
'enrol_self_enrol_user',
|
'enrol_self_get_instance_info',
|
'gradereport_user_get_grades_table',
|
'gradereport_user_view_grade_report',
|
'message_airnotifier_are_notification_preferences_configured',
|
'message_airnotifier_is_system_configured',
|
),
|