From: gggeek Date: Sat, 21 Feb 2015 21:23:53 +0000 (+0000) Subject: Fix newlines (to satisfy automated code quality scanners) X-Git-Tag: 4.0.0-alpha^2~180 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d5fba766c7c3b7ef3e615d7cb0bbc3042855718f;p=plcapi.git Fix newlines (to satisfy automated code quality scanners) --- diff --git a/composer.json b/composer.json index 30644908..7e1a9af2 100644 --- a/composer.json +++ b/composer.json @@ -18,4 +18,4 @@ "autoload": { "psr-4": {"PhpXmlRpc\\": "src/"} } -} \ No newline at end of file +} diff --git a/demo/client/introspect.php b/demo/client/introspect.php index 1fff47ab..cd084233 100644 --- a/demo/client/introspect.php +++ b/demo/client/introspect.php @@ -1 +1,79 @@ - xmlrpc

Introspect demo

Query server for available methods and their description

The code demonstrates usage of multicall and introspection methods

faultCode() . " Reason: '" . $r->faultString() . "'
"; } // 'new style' client constuctor $c = new xmlrpc_client("http://phpxmlrpc.sourceforge.net/server.php"); print "

methods available at http://" . $c->server . $c->path . "

\n"; $m = new xmlrpcmsg('system.listMethods'); $r = &$c->send($m); if ($r->faultCode()) { display_error($r); } else { $v = $r->value(); for ($i = 0; $i < $v->arraysize(); $i++) { $mname = $v->arraymem($i); print "

" . $mname->scalarval() . "

\n"; // build messages first, add params later $m1 = new xmlrpcmsg('system.methodHelp'); $m2 = new xmlrpcmsg('system.methodSignature'); $val = new xmlrpcval($mname->scalarval(), "string"); $m1->addParam($val); $m2->addParam($val); // send multiple messages in one pass. // If server does not support multicall, client will fall back to 2 separate calls $ms = array($m1, $m2); $rs = &$c->send($ms); if ($rs[0]->faultCode()) { display_error($rs[0]); } else { $val = $rs[0]->value(); $txt = $val->scalarval(); if ($txt != "") { print "

Documentation

${txt}

\n"; } else { print "

No documentation available.

\n"; } } if ($rs[1]->faultCode()) { display_error($rs[1]); } else { print "

Signature

\n"; $val = $rs[1]->value(); if ($val->kindOf() == "array") { for ($j = 0; $j < $val->arraysize(); $j++) { $x = $val->arraymem($j); $ret = $x->arraymem(0); print "" . $ret->scalarval() . " " . $mname->scalarval() . "("; if ($x->arraysize() > 1) { for ($k = 1; $k < $x->arraysize(); $k++) { $y = $x->arraymem($k); print $y->scalarval(); if ($k < $x->arraysize() - 1) { print ", "; } } } print ")
\n"; } } else { print "Signature unknown\n"; } print "

\n"; } } } ?> \ No newline at end of file + +xmlrpc + +

Introspect demo

+

Query server for available methods and their description

+

The code demonstrates usage of multicall and introspection methods

+faultCode() + . " Reason: '" . $r->faultString() . "'
"; +} +// 'new style' client constructor +$c = new xmlrpc_client("http://phpxmlrpc.sourceforge.net/server.php"); +print "

methods available at http://" . $c->server . $c->path . "

\n"; +$m = new xmlrpcmsg('system.listMethods'); +$r = &$c->send($m); +if ($r->faultCode()) { + display_error($r); +} else { + $v = $r->value(); + for ($i = 0; $i < $v->arraysize(); $i++) { + $mname = $v->arraymem($i); + print "

" . $mname->scalarval() . "

\n"; + // build messages first, add params later + $m1 = new xmlrpcmsg('system.methodHelp'); + $m2 = new xmlrpcmsg('system.methodSignature'); + $val = new xmlrpcval($mname->scalarval(), "string"); + $m1->addParam($val); + $m2->addParam($val); + // send multiple messages in one pass. + // If server does not support multicall, client will fall back to 2 separate calls + $ms = array($m1, $m2); + $rs = &$c->send($ms); + if ($rs[0]->faultCode()) { + display_error($rs[0]); + } else { + $val = $rs[0]->value(); + $txt = $val->scalarval(); + if ($txt != "") { + print "

Documentation

${txt}

\n"; + } else { + print "

No documentation available.

\n"; + } + } + if ($rs[1]->faultCode()) { + display_error($rs[1]); + } else { + print "

Signature

\n"; + $val = $rs[1]->value(); + if ($val->kindOf() == "array") { + for ($j = 0; $j < $val->arraysize(); $j++) { + $x = $val->arraymem($j); + $ret = $x->arraymem(0); + print "" . $ret->scalarval() . " " + . $mname->scalarval() . "("; + if ($x->arraysize() > 1) { + for ($k = 1; $k < $x->arraysize(); $k++) { + $y = $x->arraymem($k); + print $y->scalarval(); + if ($k < $x->arraysize() - 1) { + print ", "; + } + } + } + print ")
\n"; + } + } else { + print "Signature unknown\n"; + } + print "

\n"; + } + } +} +?> + + diff --git a/demo/client/which.php b/demo/client/which.php index db2d8c17..f6ef45d1 100644 --- a/demo/client/which.php +++ b/demo/client/which.php @@ -1 +1,26 @@ - xmlrpc

Which toolkit demo

Query server for toolkit information

The code demonstrates usage of the php_xmlrpc_decode function

send($f); if (!$r->faultCode()) { $v = php_xmlrpc_decode($r->value()); print "
";


    print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";


    print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";


    print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";


    print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";


    print "
"; } else { print "An error occurred: "; print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n"; } ?> \ No newline at end of file + +xmlrpc + +

Which toolkit demo

+

Query server for toolkit information

+

The code demonstrates usage of the php_xmlrpc_decode function

+send($f); +if (!$r->faultCode()) { + $v = php_xmlrpc_decode($r->value()); + print "
";
+    print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";
+    print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";
+    print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";
+    print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";
+    print "
"; +} else { + print "An error occurred: "; + print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n"; +} +?> + + diff --git a/doc/.gitignore b/doc/.gitignore index 898ede16..bace1405 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,4 +1,4 @@ out/ javadoc-out/ xmlrpc_php.pdf -xmlrpc_php.fo.xml \ No newline at end of file +xmlrpc_php.fo.xml