我們可以通過yourplugin/DB與格式,將mnet.php添加更多的MNET服務:
$publishes = array(
'mnet_enrol' => array(
'apiversion' => 1,
'classname' => 'enrol_mnet_mnetservice_enrol',
'filename' => 'enrol.php',
'methods' => array(
'available_courses',
'user_enrolments',
'enrol_user',
'unenrol_user',
'course_enrolments',
'category_enrolments'
),
),
);
$subscribes = array(
'mnet_enrol' => array(
'available_courses' => 'enrol/mnet/enrol.php/available_courses',
'user_enrolments' => 'enrol/mnet/enrol.php/user_enrolments',
'enrol_user' => 'enrol/mnet/enrol.php/enrol_user',
'unenrol_user' => 'enrol/mnet/enrol.php/unenrol_user',
'course_enrolments' => 'enrol/mnet/enrol.php/course_enrolments',
'category_enrolments'=>'enrol/mnet/enrol.php/category_enrolments'
),
);
新MNET服務功能店mnet_remote_rpc表:
+---------------------+----------------------------------------------+
| functionname | xmlrpcpath |
+---------------------+----------------------------------------------+
| user_authorise | auth/mnet/auth.php/user_authorise |
| keepalive_server | auth/mnet/auth.php/keepalive_server |
| kill_children | auth/mnet/auth.php/kill_children |
| refresh_log | auth/mnet/auth.php/refresh_log |
| fetch_user_image | auth/mnet/auth.php/fetch_user_image |
| fetch_theme_info | auth/mnet/auth.php/fetch_theme_info |
| update_enrolments | auth/mnet/auth.php/update_enrolments |
| keepalive_client | auth/mnet/auth.php/keepalive_client |
| kill_child | auth/mnet/auth.php/kill_child |
| available_courses | enrol/mnet/enrol.php/available_courses |
| user_enrolments | enrol/mnet/enrol.php/user_enrolments |
| enrol_user | enrol/mnet/enrol.php/enrol_user |
| unenrol_user | enrol/mnet/enrol.php/unenrol_user |
| course_enrolments | enrol/mnet/enrol.php/course_enrolments |
| send_content_intent | portfolio/mahara/lib.php/send_content_intent |
| send_content_ready | portfolio/mahara/lib.php/send_content_ready |
| category_enrolments | enrol/mnet/enrol.php/category_enrolments |
+---------------------+----------------------------------------------+
它與添加新的Web服務一樣。要更新新服務,您需要在version.php中增加版本。