@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LocalFileTestCase.php'; |
|
3 | +include_once __DIR__.'/LocalFileTestCase.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests for php files in the 'demo' directory |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | $this->args = argParser::getArgs(); |
13 | 13 | |
14 | - $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['URI'] ); |
|
14 | + $this->baseUrl = $this->args['LOCALSERVER'].str_replace('/demo/server/server.php', '/demo/', $this->args['URI']); |
|
15 | 15 | |
16 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
16 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function testAgeSort() |
@@ -3,16 +3,16 @@ discard block |
||
3 | 3 | <body> |
4 | 4 | <?php |
5 | 5 | |
6 | -include_once __DIR__ . "/../vendor/autoload.php"; |
|
6 | +include_once __DIR__."/../vendor/autoload.php"; |
|
7 | 7 | |
8 | 8 | $req = new PhpXmlRpc\Request('examples.getStateName'); |
9 | 9 | |
10 | 10 | print "<h3>Testing value serialization</h3>\n"; |
11 | 11 | |
12 | 12 | $v = new PhpXmlRpc\Value(23, "int"); |
13 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
13 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
14 | 14 | $v = new PhpXmlRpc\Value("What are you saying? >> << &&"); |
15 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
15 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
16 | 16 | |
17 | 17 | $v = new PhpXmlRpc\Value(array( |
18 | 18 | new PhpXmlRpc\Value("ABCDEFHIJ"), |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | "array" |
22 | 22 | ); |
23 | 23 | |
24 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
24 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
25 | 25 | |
26 | 26 | $v = new PhpXmlRpc\Value( |
27 | 27 | array( |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | "struct" |
50 | 50 | ); |
51 | 51 | |
52 | -print "<PRE>" . htmlentities($v->serialize()) . "</PRE>"; |
|
52 | +print "<PRE>".htmlentities($v->serialize())."</PRE>"; |
|
53 | 53 | |
54 | 54 | $w = new PhpXmlRpc\Value(array($v, new PhpXmlRpc\Value("That was the struct!")), "array"); |
55 | 55 | |
56 | -print "<PRE>" . htmlentities($w->serialize()) . "</PRE>"; |
|
56 | +print "<PRE>".htmlentities($w->serialize())."</PRE>"; |
|
57 | 57 | |
58 | 58 | $w = new PhpXmlRpc\Value("Mary had a little lamb, |
59 | 59 | Whose fleece was white as snow, |
@@ -65,26 +65,26 @@ discard block |
||
65 | 65 | Ten thousand volts went down its back |
66 | 66 | And turned it into nylon", "base64" |
67 | 67 | ); |
68 | -print "<PRE>" . htmlentities($w->serialize()) . "</PRE>"; |
|
69 | -print "<PRE>Value of base64 string is: '" . $w->scalarval() . "'</PRE>"; |
|
68 | +print "<PRE>".htmlentities($w->serialize())."</PRE>"; |
|
69 | +print "<PRE>Value of base64 string is: '".$w->scalarval()."'</PRE>"; |
|
70 | 70 | |
71 | 71 | $req->method(''); |
72 | 72 | $req->addParam(new PhpXmlRpc\Value("41", "int")); |
73 | 73 | |
74 | 74 | print "<h3>Testing request serialization</h3>\n"; |
75 | 75 | $op = $req->serialize(); |
76 | -print "<PRE>" . htmlentities($op) . "</PRE>"; |
|
76 | +print "<PRE>".htmlentities($op)."</PRE>"; |
|
77 | 77 | |
78 | 78 | print "<h3>Testing ISO date format</h3><pre>\n"; |
79 | 79 | |
80 | 80 | $t = time(); |
81 | 81 | $date = PhpXmlRpc\Helper\Date::iso8601Encode($t); |
82 | 82 | print "Now is $t --> $date\n"; |
83 | -print "Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n"; |
|
83 | +print "Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n"; |
|
84 | 84 | $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date); |
85 | 85 | print "That is to say $date --> $tb\n"; |
86 | -print "Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n"; |
|
87 | -print "Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($date, 1) . "\n"; |
|
86 | +print "Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n"; |
|
87 | +print "Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($date, 1)."\n"; |
|
88 | 88 | |
89 | 89 | print "</pre>\n"; |
90 | 90 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . "/../../vendor/autoload.php"; |
|
3 | +include_once __DIR__."/../../vendor/autoload.php"; |
|
4 | 4 | |
5 | 5 | use PhpXmlRpc\Value; |
6 | 6 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | $count = 0; |
32 | 32 | } |
33 | 33 | // add the new comment in |
34 | - dba_insert($msgID . "_comment_${count}", $comment, $dbh); |
|
35 | - dba_insert($msgID . "_name_${count}", $name, $dbh); |
|
34 | + dba_insert($msgID."_comment_${count}", $comment, $dbh); |
|
35 | + dba_insert($msgID."_name_${count}", $name, $dbh); |
|
36 | 36 | $count++; |
37 | 37 | dba_replace($countID, $count, $dbh); |
38 | 38 | dba_close($dbh); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $countID = "${msgID}_count"; |
66 | 66 | if (dba_exists($countID, $dbh)) { |
67 | 67 | $count = dba_fetch($countID, $dbh); |
68 | - for ($i = 0; $i < $count; $i++) { |
|
68 | + for ($i = 0; $i<$count; $i++) { |
|
69 | 69 | $name = dba_fetch("${msgID}_name_${i}", $dbh); |
70 | 70 | $comment = dba_fetch("${msgID}_comment_${i}", $dbh); |
71 | 71 | // push a new struct onto the return array |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Demo server for xmlrpc library. |
|
4 | - * |
|
5 | - * Implements a lot of webservices, including a suite of services used for |
|
6 | - * interoperability testing (validator1 methods), and some whose only purpose |
|
7 | - * is to be used for unit-testing the library. |
|
8 | - * |
|
9 | - * Please do not copy this file verbatim into your production server. |
|
10 | - **/ |
|
3 | + * Demo server for xmlrpc library. |
|
4 | + * |
|
5 | + * Implements a lot of webservices, including a suite of services used for |
|
6 | + * interoperability testing (validator1 methods), and some whose only purpose |
|
7 | + * is to be used for unit-testing the library. |
|
8 | + * |
|
9 | + * Please do not copy this file verbatim into your production server. |
|
10 | + **/ |
|
11 | 11 | |
12 | 12 | // give user a chance to see the source for this server instead of running the services |
13 | 13 | if ($_SERVER['REQUEST_METHOD'] != 'POST' && isset($_GET['showSource'])) { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | die(); |
16 | 16 | } |
17 | 17 | |
18 | -include_once __DIR__ . "/../../vendor/autoload.php"; |
|
18 | +include_once __DIR__."/../../vendor/autoload.php"; |
|
19 | 19 | |
20 | 20 | // out-of-band information: let the client manipulate the server operations. |
21 | 21 | // we do this to help the testsuite script: do not reproduce in production! |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']); |
26 | 26 | } |
27 | 27 | |
28 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
28 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | use PhpXmlRpc\Value; |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | // extract the value of the state number |
123 | 123 | $snv = $sno->scalarval(); |
124 | 124 | // look it up in our array (zero-based) |
125 | - if (isset($stateNames[$snv - 1])) { |
|
126 | - $stateName = $stateNames[$snv - 1]; |
|
125 | + if (isset($stateNames[$snv-1])) { |
|
126 | + $stateName = $stateNames[$snv-1]; |
|
127 | 127 | } else { |
128 | 128 | // not there, so complain |
129 | - $err = "I don't have a state for the index '" . $snv . "'"; |
|
129 | + $err = "I don't have a state for the index '".$snv."'"; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // if we generated an error, create an error return response |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | { |
153 | 153 | global $stateNames; |
154 | 154 | |
155 | - if (isset($stateNames[$stateNo - 1])) { |
|
156 | - return $stateNames[$stateNo - 1]; |
|
155 | + if (isset($stateNames[$stateNo-1])) { |
|
156 | + return $stateNames[$stateNo-1]; |
|
157 | 157 | } else { |
158 | 158 | // not, there so complain |
159 | - throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
159 | + throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
@@ -186,17 +186,17 @@ discard block |
||
186 | 186 | eval($findstate9_sig['source']); |
187 | 187 | |
188 | 188 | $findstate10_sig = array( |
189 | - "function" => function ($req) { return findState($req); }, |
|
189 | + "function" => function($req) { return findState($req); }, |
|
190 | 190 | "signature" => $findstate_sig, |
191 | 191 | "docstring" => $findstate_doc, |
192 | 192 | ); |
193 | 193 | |
194 | -$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return inner_findstate($stateNo); }); |
|
194 | +$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return inner_findstate($stateNo); }); |
|
195 | 195 | |
196 | 196 | $c = new xmlrpcServerMethodsContainer; |
197 | 197 | $moreSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'tests.', 'method_type' => 'all')); |
198 | 198 | |
199 | -$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
199 | +$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
200 | 200 | |
201 | 201 | // used to test signatures with NULL params |
202 | 202 | $findstate12_sig = array( |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $s = $req->getParam(0); |
223 | 223 | $t = $req->getParam(1); |
224 | 224 | |
225 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcInt)); |
|
225 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcInt)); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | $addtwodouble_sig = array(array(Value::$xmlrpcDouble, Value::$xmlrpcDouble, Value::$xmlrpcDouble)); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $s = $req->getParam(0); |
233 | 233 | $t = $req->getParam(1); |
234 | 234 | |
235 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcDouble)); |
|
235 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcDouble)); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | $stringecho_sig = array(array(Value::$xmlrpcString, Value::$xmlrpcString)); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | function echoBack($req) |
249 | 249 | { |
250 | 250 | // just sends back a string with what i got sent to me, just escaped, that's all |
251 | - $s = "I got the following message:\n" . $req->serialize(); |
|
251 | + $s = "I got the following message:\n".$req->serialize(); |
|
252 | 252 | |
253 | 253 | return new PhpXmlRpc\Response(new Value($s)); |
254 | 254 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | return 0; |
306 | 306 | } |
307 | 307 | |
308 | - return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1; |
|
308 | + return ($agesorter_arr[$a]>$agesorter_arr[$b]) ? -1 : 1; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | $agesorter_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray)); |
@@ -406,17 +406,17 @@ discard block |
||
406 | 406 | $err = "Error, no 'From' field specified"; |
407 | 407 | } |
408 | 408 | |
409 | - $msgHdr = "From: " . $mFrom->scalarval() . "\n"; |
|
410 | - $msgHdr .= "To: " . $mTo->scalarval() . "\n"; |
|
409 | + $msgHdr = "From: ".$mFrom->scalarval()."\n"; |
|
410 | + $msgHdr .= "To: ".$mTo->scalarval()."\n"; |
|
411 | 411 | |
412 | 412 | if ($mCc->scalarval() != "") { |
413 | - $msgHdr .= "Cc: " . $mCc->scalarval() . "\n"; |
|
413 | + $msgHdr .= "Cc: ".$mCc->scalarval()."\n"; |
|
414 | 414 | } |
415 | 415 | if ($mBcc->scalarval() != "") { |
416 | - $msgHdr .= "Bcc: " . $mBcc->scalarval() . "\n"; |
|
416 | + $msgHdr .= "Bcc: ".$mBcc->scalarval()."\n"; |
|
417 | 417 | } |
418 | 418 | if ($mMime->scalarval() != "") { |
419 | - $msgHdr .= "Content-type: " . $mMime->scalarval() . "\n"; |
|
419 | + $msgHdr .= "Content-type: ".$mMime->scalarval()."\n"; |
|
420 | 420 | } |
421 | 421 | $msgHdr .= "X-Mailer: XML-RPC for PHP mailer 1.0"; |
422 | 422 | |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | $moe = $sno["moe"]; |
507 | 507 | $larry = $sno["larry"]; |
508 | 508 | $curly = $sno["curly"]; |
509 | - $num = $moe->scalarval() + $larry->scalarval() + $curly->scalarval(); |
|
509 | + $num = $moe->scalarval()+$larry->scalarval()+$curly->scalarval(); |
|
510 | 510 | |
511 | 511 | return new PhpXmlRpc\Response(new Value($num, Value::$xmlrpcInt)); |
512 | 512 | } |
@@ -548,9 +548,9 @@ discard block |
||
548 | 548 | $ar = $req->getParam(0); |
549 | 549 | $sz = $ar->count(); |
550 | 550 | $first = $ar[0]; |
551 | - $last = $ar[$sz - 1]; |
|
551 | + $last = $ar[$sz-1]; |
|
552 | 552 | |
553 | - return new PhpXmlRpc\Response(new Value($first->scalarval() . |
|
553 | + return new PhpXmlRpc\Response(new Value($first->scalarval(). |
|
554 | 554 | $last->scalarval(), Value::$xmlrpcString)); |
555 | 555 | } |
556 | 556 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | $larry = $fools["larry"]; |
585 | 585 | $moe = $fools["moe"]; |
586 | 586 | |
587 | - return new PhpXmlRpc\Response(new Value($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), Value::$xmlrpcInt)); |
|
587 | + return new PhpXmlRpc\Response(new Value($curly->scalarval()+$larry->scalarval()+$moe->scalarval(), Value::$xmlrpcInt)); |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | $v1_countTheEntities_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcString)); |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $ap = 0; |
599 | 599 | $qu = 0; |
600 | 600 | $amp = 0; |
601 | - for ($i = 0; $i < strlen($str); $i++) { |
|
601 | + for ($i = 0; $i<strlen($str); $i++) { |
|
602 | 602 | $c = substr($str, $i, 1); |
603 | 603 | switch ($c) { |
604 | 604 | case ">": |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | ), |
801 | 801 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
802 | 802 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
803 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
803 | + "tests.utf8methodname.".'κόσμε' => array( |
|
804 | 804 | "function" => "stringEcho", |
805 | 805 | "signature" => $stringecho_sig, |
806 | 806 | "docstring" => $stringecho_doc, |
@@ -977,5 +977,5 @@ discard block |
||
977 | 977 | // out-of-band information: let the client manipulate the server operations. |
978 | 978 | // we do this to help the testsuite script: do not reproduce in production! |
979 | 979 | if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) { |
980 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
980 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
981 | 981 | } |
@@ -209,11 +209,12 @@ |
||
209 | 209 | $a = $req->getParam(0); |
210 | 210 | $b = $req->getParam(1); |
211 | 211 | |
212 | - if ($a->scalartyp() == Value::$xmlrpcNull) |
|
213 | - return new PhpXmlRpc\Response(new Value(inner_findstate($b->scalarval()))); |
|
214 | - else |
|
215 | - return new PhpXmlRpc\Response(new Value(inner_findstate($a->scalarval()))); |
|
216 | -} |
|
212 | + if ($a->scalartyp() == Value::$xmlrpcNull) { |
|
213 | + return new PhpXmlRpc\Response(new Value(inner_findstate($b->scalarval()))); |
|
214 | + } else { |
|
215 | + return new PhpXmlRpc\Response(new Value(inner_findstate($a->scalarval()))); |
|
216 | + } |
|
217 | + } |
|
217 | 218 | |
218 | 219 | $addtwo_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcInt, Value::$xmlrpcInt)); |
219 | 220 | $addtwo_doc = 'Add two integers together and return the result'; |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * XMLRPC server acting as proxy for requests to other servers |
|
4 | - * (useful e.g. for ajax-originated calls that can only connect back to |
|
5 | - * the originating server). |
|
6 | - * |
|
7 | - * @author Gaetano Giunta |
|
8 | - * @copyright (C) 2006-2015 G. Giunta |
|
9 | - * @license code licensed under the BSD License: see file license.txt |
|
10 | - */ |
|
3 | + * XMLRPC server acting as proxy for requests to other servers |
|
4 | + * (useful e.g. for ajax-originated calls that can only connect back to |
|
5 | + * the originating server). |
|
6 | + * |
|
7 | + * @author Gaetano Giunta |
|
8 | + * @copyright (C) 2006-2015 G. Giunta |
|
9 | + * @license code licensed under the BSD License: see file license.txt |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | include_once __DIR__ . "/../../src/Autoloader.php"; |
13 | 13 | PhpXmlRpc\Autoloader::register(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @license code licensed under the BSD License: see file license.txt |
10 | 10 | */ |
11 | 11 | |
12 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
12 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
13 | 13 | PhpXmlRpc\Autoloader::register(); |
14 | 14 | |
15 | 15 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $url = $encoder->decode($req->getParam(0)); |
31 | 31 | $client = new PhpXmlRpc\Client($url); |
32 | 32 | |
33 | - if ($req->getNumParams() > 3) { |
|
33 | + if ($req->getNumParams()>3) { |
|
34 | 34 | // we have to set some options onto the client. |
35 | 35 | // Note that if we do not untaint the received values, warnings might be generated... |
36 | 36 | $options = $encoder->decode($req->getParam(3)); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $client->setSSLVerifyPeer($val); |
51 | 51 | break; |
52 | 52 | case 'Timeout': |
53 | - $timeout = (integer)$val; |
|
53 | + $timeout = (integer) $val; |
|
54 | 54 | break; |
55 | 55 | } // switch |
56 | 56 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | // add debug info into response we give back to caller |
71 | - PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: " . $req->serialize()); |
|
71 | + PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: ".$req->serialize()); |
|
72 | 72 | |
73 | 73 | return $client->send($req, $timeout); |
74 | 74 | } |
@@ -6,20 +6,20 @@ discard block |
||
6 | 6 | <h3>The code demonstrates usage of multicall and introspection methods</h3> |
7 | 7 | <?php |
8 | 8 | |
9 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
9 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
10 | 10 | PhpXmlRpc\Autoloader::register(); |
11 | 11 | |
12 | 12 | function display_error($r) |
13 | 13 | { |
14 | 14 | print "An error occurred: "; |
15 | - print "Code: " . $r->faultCode() |
|
16 | - . " Reason: '" . $r->faultString() . "'<br/>"; |
|
15 | + print "Code: ".$r->faultCode() |
|
16 | + . " Reason: '".$r->faultString()."'<br/>"; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | $client = new PhpXmlRpc\Client("http://phpxmlrpc.sourceforge.net/server.php"); |
20 | 20 | |
21 | 21 | // First off, let's retrieve the list of methods available on the remote server |
22 | -print "<h3>methods available at http://" . $client->server . $client->path . "</h3>\n"; |
|
22 | +print "<h3>methods available at http://".$client->server.$client->path."</h3>\n"; |
|
23 | 23 | $req = new PhpXmlRpc\Request('system.listMethods'); |
24 | 24 | $resp = $client->send($req); |
25 | 25 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | // Then, retrieve the signature and help text of each available method |
32 | 32 | foreach ($v as $methodName) { |
33 | - print "<h4>" . $methodName->scalarval() . "</h4>\n"; |
|
33 | + print "<h4>".$methodName->scalarval()."</h4>\n"; |
|
34 | 34 | // build messages first, add params later |
35 | 35 | $m1 = new PhpXmlRpc\Request('system.methodHelp'); |
36 | 36 | $m2 = new PhpXmlRpc\Request('system.methodSignature'); |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | if ($val->kindOf() == "array") { |
62 | 62 | foreach ($val as $x) { |
63 | 63 | $ret = $x[0]; |
64 | - print "<code>" . $ret->scalarval() . " " |
|
65 | - . $methodName->scalarval() . "("; |
|
66 | - if ($x->count() > 1) { |
|
67 | - for ($k = 1; $k < $x->count(); $k++) { |
|
64 | + print "<code>".$ret->scalarval()." " |
|
65 | + . $methodName->scalarval()."("; |
|
66 | + if ($x->count()>1) { |
|
67 | + for ($k = 1; $k<$x->count(); $k++) { |
|
68 | 68 | $y = $x[$k]; |
69 | 69 | print $y->scalarval(); |
70 | - if ($k < $x->count() - 1) { |
|
70 | + if ($k<$x->count()-1) { |
|
71 | 71 | print ", "; |
72 | 72 | } |
73 | 73 | } |
@@ -12,14 +12,14 @@ discard block |
||
12 | 12 | </h3> |
13 | 13 | <?php |
14 | 14 | |
15 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
15 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
16 | 16 | PhpXmlRpc\Autoloader::register(); |
17 | 17 | |
18 | 18 | $client = new PhpXmlRpc\Client("http://phpxmlrpc.sourceforge.net/server.php"); |
19 | 19 | $client->return_type = 'phpvals'; // let client give us back php values instead of xmlrpcvals |
20 | 20 | $resp = $client->send(new PhpXmlRpc\Request('system.listMethods')); |
21 | 21 | if ($resp->faultCode()) { |
22 | - echo "<p>Server methods list could not be retrieved: error {$resp->faultCode()} '" . htmlspecialchars($resp->faultString()) . "'</p>\n"; |
|
22 | + echo "<p>Server methods list could not be retrieved: error {$resp->faultCode()} '".htmlspecialchars($resp->faultString())."'</p>\n"; |
|
23 | 23 | } else { |
24 | 24 | echo "<p>Server methods list retrieved, now wrapping it up...</p>\n<ul>\n"; |
25 | 25 | flush(); |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | if ($methodName == 'examples.getStateName') { |
32 | 32 | $callable = $wrapper->wrapXmlrpcMethod($client, $methodName); |
33 | 33 | if ($callable) { |
34 | - echo "<li>Remote server method " . htmlspecialchars($methodName) . " wrapped into php function</li>\n"; |
|
34 | + echo "<li>Remote server method ".htmlspecialchars($methodName)." wrapped into php function</li>\n"; |
|
35 | 35 | } else { |
36 | - echo "<li>Remote server method " . htmlspecialchars($methodName) . " could not be wrapped!</li>\n"; |
|
36 | + echo "<li>Remote server method ".htmlspecialchars($methodName)." could not be wrapped!</li>\n"; |
|
37 | 37 | } |
38 | 38 | break; |
39 | 39 | } |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | <p></p> |
11 | 11 | <?php |
12 | 12 | |
13 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
13 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
14 | 14 | PhpXmlRpc\Autoloader::register(); |
15 | 15 | |
16 | 16 | $inAr = array("Dave" => 24, "Edd" => 45, "Joe" => 37, "Fred" => 27); |
17 | 17 | print "This is the input data:<br/><pre>"; |
18 | -foreach($inAr as $key => $val) { |
|
19 | - print $key . ", " . $val . "\n"; |
|
18 | +foreach ($inAr as $key => $val) { |
|
19 | + print $key.", ".$val."\n"; |
|
20 | 20 | } |
21 | 21 | print "</pre>"; |
22 | 22 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ); |
33 | 33 | } |
34 | 34 | $v = new PhpXmlRpc\Value($p, "array"); |
35 | -print "Encoded into xmlrpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n"; |
|
35 | +print "Encoded into xmlrpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n"; |
|
36 | 36 | |
37 | 37 | // create client and message objects |
38 | 38 | $req = new PhpXmlRpc\Request('examples.sortByAge', array($v)); |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | foreach ($value as $struct) { |
53 | 53 | $name = $struct["name"]; |
54 | 54 | $age = $struct["age"]; |
55 | - print htmlspecialchars($name->scalarval()) . ", " . htmlspecialchars($age->scalarval()) . "\n"; |
|
55 | + print htmlspecialchars($name->scalarval()).", ".htmlspecialchars($age->scalarval())."\n"; |
|
56 | 56 | } |
57 | 57 | |
58 | - print "<hr/>For nerds: I got this value back<br/><pre>" . |
|
59 | - htmlentities($resp->serialize()) . "</pre><hr/>\n"; |
|
58 | + print "<hr/>For nerds: I got this value back<br/><pre>". |
|
59 | + htmlentities($resp->serialize())."</pre><hr/>\n"; |
|
60 | 60 | } else { |
61 | 61 | print "An error occurred:<pre>"; |
62 | - print "Code: " . htmlspecialchars($resp->faultCode()) . |
|
63 | - "\nReason: '" . htmlspecialchars($resp->faultString()) . '\'</pre><hr/>'; |
|
62 | + print "Code: ".htmlspecialchars($resp->faultCode()). |
|
63 | + "\nReason: '".htmlspecialchars($resp->faultString()).'\'</pre><hr/>'; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | ?> |
@@ -6,7 +6,7 @@ |
||
6 | 6 | <h3>The code demonstrates usage for the terminally lazy. For a more complete proxy, look at at the Wrapper class</h3> |
7 | 7 | <?php |
8 | 8 | |
9 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
9 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
10 | 10 | PhpXmlRpc\Autoloader::register(); |
11 | 11 | |
12 | 12 | class PhpXmlRpcProxy |