forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rpclib.php
78 lines (66 loc) · 2.09 KB
/
rpclib.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Some dummy functions to test XML-RPC with
*/
/**
* The xxxx_RPC_OK must exist and return TRUE for the remote call to be
* permitted
*
* @return bool True if the related function can be executed remotely
*/
function mnet_concatenate_strings_RPC_OK() {
return true;
}
function mnet_publishes() {
$servicelist = array();
$service['name'] = 'sso';
$function['name'] = 'mnet_concatenate_strings';
// first argument
$argument['type'] = 'string';
$argument['default'] = '';
$function['arguments'][] = $argument;
// second argument
$argument['type'] = 'string';
$argument['default'] = '';
$function['arguments'][] = $argument;
// third argument
$argument['type'] = 'string';
$argument['default'] = '';
$function['arguments'][] = $argument;
$function['description'] = get_string($function['name'], 'mnet');
$service['functions'][] = $function;
$servicelist[] = $service;
return $servicelist;
}
//header('Content-type: text/plain');
//var_dump(mnet_publishes());
/**
* Concatenate (up to) 3 strings and return the result
* @service sso
* @param string $string1 Some string
* @param string $string2 Some string
* @param string $string3 Some string
* @return string The parameter strings, concatenated together
*/
function mnet_concatenate_strings($string1='', $string2='', $string3='') {
return $string1.$string2.$string3;
}
class testClass {
function testClass() {
$this->first = 'last';
$this->last = 'first';
}
function augment_first($newval) {
$this->first = $this->first.$newval;
return $this->first;
}
function augment_first_RPC_OK() {
return true;
}
function mnet_concatenate_strings_RPC_OK() {
return true;
}
function mnet_concatenate_strings($string1='', $string2='', $string3='') {
return $string1.$string2.$string3;
}
}