@@ -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'; |
@@ -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 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | <h3>The code demonstrates usage of the PhpXmlRpc\Encoder 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 | $req = new PhpXmlRpc\Request('interopEchoTests.whichToolkit', array()); |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | $encoder = new PhpXmlRpc\Encoder(); |
17 | 17 | $value = $encoder->decode($resp->value()); |
18 | 18 | print "<pre>"; |
19 | - print "name: " . htmlspecialchars($value["toolkitName"]) . "\n"; |
|
20 | - print "version: " . htmlspecialchars($value["toolkitVersion"]) . "\n"; |
|
21 | - print "docs: " . htmlspecialchars($value["toolkitDocsUrl"]) . "\n"; |
|
22 | - print "os: " . htmlspecialchars($value["toolkitOperatingSystem"]) . "\n"; |
|
19 | + print "name: ".htmlspecialchars($value["toolkitName"])."\n"; |
|
20 | + print "version: ".htmlspecialchars($value["toolkitVersion"])."\n"; |
|
21 | + print "docs: ".htmlspecialchars($value["toolkitDocsUrl"])."\n"; |
|
22 | + print "os: ".htmlspecialchars($value["toolkitOperatingSystem"])."\n"; |
|
23 | 23 | print "</pre>"; |
24 | 24 | } else { |
25 | 25 | print "An error occurred: "; |
26 | - print "Code: " . htmlspecialchars($resp->faultCode()) . " Reason: '" . htmlspecialchars($resp->faultString()) . "'\n"; |
|
26 | + print "Code: ".htmlspecialchars($resp->faultCode())." Reason: '".htmlspecialchars($resp->faultString())."'\n"; |
|
27 | 27 | } |
28 | 28 | ?> |
29 | 29 | </body> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | method)</p> |
21 | 21 | <?php |
22 | 22 | |
23 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
23 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
24 | 24 | PhpXmlRpc\Autoloader::register(); |
25 | 25 | |
26 | 26 | if (isset($_POST["mailto"]) && $_POST["mailto"]) { |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | print "<fonr color=\"red\">"; |
45 | 45 | print "Mail send failed<br/>\n"; |
46 | 46 | print "Fault: "; |
47 | - print "Code: " . htmlspecialchars($resp->faultCode()) . |
|
48 | - " Reason: '" . htmlspecialchars($resp->faultString()) . "'<br/>"; |
|
47 | + print "Code: ".htmlspecialchars($resp->faultCode()). |
|
48 | + " Reason: '".htmlspecialchars($resp->faultString())."'<br/>"; |
|
49 | 49 | print "</font><br/>"; |
50 | 50 | } |
51 | 51 | } |
@@ -8,34 +8,34 @@ |
||
8 | 8 | <h3>The code demonstrates usage of automatic encoding/decoding of php variables into xmlrpc values</h3> |
9 | 9 | <?php |
10 | 10 | |
11 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
11 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
12 | 12 | PhpXmlRpc\Autoloader::register(); |
13 | 13 | |
14 | 14 | if (isset($_POST["stateno"]) && $_POST["stateno"] != "") { |
15 | - $stateNo = (integer)$_POST["stateno"]; |
|
15 | + $stateNo = (integer) $_POST["stateno"]; |
|
16 | 16 | $encoder = new PhpXmlRpc\Encoder(); |
17 | 17 | $req = new PhpXmlRpc\Request('examples.getStateName', |
18 | 18 | array($encoder->encode($stateNo)) |
19 | 19 | ); |
20 | - print "Sending the following request:<pre>\n\n" . htmlentities($req->serialize()) . "\n\n</pre>Debug info of server data follows...\n\n"; |
|
20 | + print "Sending the following request:<pre>\n\n".htmlentities($req->serialize())."\n\n</pre>Debug info of server data follows...\n\n"; |
|
21 | 21 | $client = new PhpXmlRpc\Client("http://phpxmlrpc.sourceforge.net/server.php"); |
22 | 22 | $client->setDebug(1); |
23 | 23 | $r = $client->send($req); |
24 | 24 | if (!$r->faultCode()) { |
25 | 25 | $v = $r->value(); |
26 | - print "<br/>State number <b>" . $stateNo . "</b> is <b>" |
|
27 | - . htmlspecialchars($encoder->decode($v)) . "</b><br/>"; |
|
26 | + print "<br/>State number <b>".$stateNo."</b> is <b>" |
|
27 | + . htmlspecialchars($encoder->decode($v))."</b><br/>"; |
|
28 | 28 | } else { |
29 | 29 | print "An error occurred: "; |
30 | - print "Code: " . htmlspecialchars($r->faultCode()) |
|
31 | - . " Reason: '" . htmlspecialchars($r->faultString()) . "'</pre><br/>"; |
|
30 | + print "Code: ".htmlspecialchars($r->faultCode()) |
|
31 | + . " Reason: '".htmlspecialchars($r->faultString())."'</pre><br/>"; |
|
32 | 32 | } |
33 | 33 | } else { |
34 | 34 | $stateNo = ""; |
35 | 35 | } |
36 | 36 | |
37 | 37 | print "<form action=\"getstatename.php\" method=\"POST\"> |
38 | -<input name=\"stateno\" value=\"" . $stateNo . "\"><input type=\"submit\" value=\"go\" name=\"submit\"></form> |
|
38 | +<input name=\"stateno\" value=\"" . $stateNo."\"><input type=\"submit\" value=\"go\" name=\"submit\"></form> |
|
39 | 39 | <p>Enter a state number to query its name</p>"; |
40 | 40 | |
41 | 41 | ?> |