|
@@ -1,5 +1,5 @@ discard block |
|
|
block discarded – undo |
|
1
|
1
|
<?php |
|
2
|
|
-require_once __DIR__ . "/client/_prepend.php"; |
|
|
2
|
+require_once __DIR__."/client/_prepend.php"; |
|
3
|
3
|
|
|
4
|
4
|
output('<html lang="en"> |
|
5
|
5
|
<head><title>xmlrpc</title></head> |
|
@@ -10,23 +10,23 @@ discard block |
|
|
block discarded – undo |
|
10
|
10
|
output("<p>Please note that in most cases you are better off using `new PhpXmlRpc\Encoder()->encode()` to create nested Value objects</p>\n"); |
|
11
|
11
|
|
|
12
|
12
|
$v = new PhpXmlRpc\Value(1234, 'int'); |
|
13
|
|
-output("Int: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
13
|
+output("Int: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
14
|
14
|
|
|
15
|
15
|
$v = new PhpXmlRpc\Value('Are the following characters escaped? < & >'); |
|
16
|
|
-output("String <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
16
|
+output("String <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
17
|
17
|
|
|
18
|
18
|
$v = new PhpXmlRpc\Value(true, 'boolean'); |
|
19
|
|
-output("Boolean: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
19
|
+output("Boolean: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
20
|
20
|
|
|
21
|
21
|
$v = new PhpXmlRpc\Value(1234.5678, 'double'); |
|
22
|
|
-output("Double: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
22
|
+output("Double: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
23
|
23
|
|
|
24
|
24
|
$v = new PhpXmlRpc\Value(time(), 'dateTime.iso8601'); |
|
25
|
|
-output("Datetime: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
25
|
+output("Datetime: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
26
|
26
|
|
|
27
|
27
|
$v = new PhpXmlRpc\Value('hello world', 'base64'); |
|
28
|
|
-output("Base64: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
29
|
|
-output("(value of base64 string is: '" . $v->scalarval() . "')<BR><BR>"); |
|
|
28
|
+output("Base64: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
|
29
|
+output("(value of base64 string is: '".$v->scalarval()."')<BR><BR>"); |
|
30
|
30
|
|
|
31
|
31
|
$v = new PhpXmlRpc\Value( |
|
32
|
32
|
array( |
|
@@ -39,7 +39,7 @@ discard block |
|
|
block discarded – undo |
|
39
|
39
|
), |
|
40
|
40
|
"array" |
|
41
|
41
|
); |
|
42
|
|
-output("Array: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
42
|
+output("Array: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
43
|
43
|
|
|
44
|
44
|
$v = new PhpXmlRpc\Value( |
|
45
|
45
|
array( |
|
@@ -59,10 +59,10 @@ discard block |
|
|
block discarded – undo |
|
59
|
59
|
), |
|
60
|
60
|
"struct" |
|
61
|
61
|
); |
|
62
|
|
-output("Struct: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
|
62
|
+output("Struct: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
63
|
63
|
|
|
64
|
64
|
$w = new PhpXmlRpc\Value(array($v), 'array'); |
|
65
|
|
-output("Array containing a struct: <PRE>" . htmlentities($w->serialize()) . "</PRE>"); |
|
|
65
|
+output("Array containing a struct: <PRE>".htmlentities($w->serialize())."</PRE>"); |
|
66
|
66
|
|
|
67
|
67
|
/*$w = new PhpXmlRpc\Value("Mary had a little lamb, |
|
68
|
68
|
Whose fleece was white as snow, |
|
@@ -81,21 +81,21 @@ discard block |
|
|
block discarded – undo |
|
81
|
81
|
$req = new PhpXmlRpc\Request('examples.getStateName'); |
|
82
|
82
|
$req->method('examples.getStateName'); |
|
83
|
83
|
$req->addParam(new PhpXmlRpc\Value(42, 'int')); |
|
84
|
|
-output("<PRE>" . htmlentities($req->serialize()) . "</PRE>"); |
|
|
84
|
+output("<PRE>".htmlentities($req->serialize())."</PRE>"); |
|
85
|
85
|
|
|
86
|
86
|
output("<h3>Testing response serialization</h3>\n"); |
|
87
|
87
|
$resp = new PhpXmlRpc\Response(new PhpXmlRpc\Value('The meaning of life')); |
|
88
|
|
-output("<PRE>" . htmlentities($resp->serialize()) . "</PRE>"); |
|
|
88
|
+output("<PRE>".htmlentities($resp->serialize())."</PRE>"); |
|
89
|
89
|
|
|
90
|
90
|
output("<h3>Testing ISO date formatting</h3><pre>\n"); |
|
91
|
91
|
$t = time(); |
|
92
|
92
|
$date = PhpXmlRpc\Helper\Date::iso8601Encode($t); |
|
93
|
93
|
output("Now is $t --> $date\n"); |
|
94
|
|
-output("Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n"); |
|
|
94
|
+output("Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n"); |
|
95
|
95
|
$tb = PhpXmlRpc\Helper\Date::iso8601Decode($date); |
|
96
|
96
|
output("That is to say $date --> $tb\n"); |
|
97
|
|
-output("Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n"); |
|
98
|
|
-output("Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1) . "\n"); |
|
|
97
|
+output("Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n"); |
|
|
98
|
+output("Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1)."\n"); |
|
99
|
99
|
output("</pre>\n"); |
|
100
|
100
|
|
|
101
|
101
|
output('</body></html>'); |