From 4c4c28971620235b1a225c106dfad85a87731a25 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 15 Jun 2014 21:47:38 +0200 Subject: [PATCH] Remove Id tag from demo files --- demo/client/agesort.php | 2 +- demo/client/client.php | 2 - demo/client/comment.php | 2 +- demo/client/introspect.php | 109 +------------------------------------ demo/client/mail.php | 2 - demo/client/which.php | 33 +---------- demo/client/wrap.php | 2 - demo/client/zopetest.php | 2 - 8 files changed, 4 insertions(+), 150 deletions(-) diff --git a/demo/client/agesort.php b/demo/client/agesort.php index 7fa16af..86febd1 100644 --- a/demo/client/agesort.php +++ b/demo/client/agesort.php @@ -1 +1 @@ - xmlrpc

Agesort demo

Send an array of 'name' => 'age' pairs to the server that will send it back sorted.

The source code demonstrates basic lib usage, including handling of xmlrpc arrays and structs

24, "Edd" => 45, "Joe" => 37, "Fred" => 27); reset($inAr); print "This is the input data:
";
while (list($key, $val)=each($inAr)) {
  print $key . ", " . $val . "\n";
}
print "
"; // create parameters from the input array: an xmlrpc array of xmlrpc structs $p=array(); foreach($inAr as $key => $val) { $p[]=new xmlrpcval(array("name" => new xmlrpcval($key), "age" => new xmlrpcval($val, "int")), "struct"); } $v=new xmlrpcval($p, "array"); print "Encoded into xmlrpc format it looks like this:
\n" .  htmlentities($v->serialize()). "
\n"; // create client and message objects $f=new xmlrpcmsg('examples.sortByAge', array($v)); $c=new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80); // set maximum debug level, to have the complete communication printed to screen $c->setDebug(2); // send request print "Now sending request (detailed debug info follows)"; $r=&$c->send($f); // check response for errors, and take appropriate action if (!$r->faultCode()) { print "The server gave me these results:
";
  $v=$r->value();
  $max=$v->arraysize();
  for($i=0; $i<$max; $i++) {
    $rec=$v->arraymem($i);
    $n=$rec->structmem("name");
    $a=$rec->structmem("age");
    print htmlspecialchars($n->scalarval()) . ", " . htmlspecialchars($a->scalarval()) . "\n";
  }

  print "
For nerds: I got this value back
" .
    htmlentities($r->serialize()). "

\n"; } else { print "An error occurred:
";
  print "Code: " . htmlspecialchars($r->faultCode()) .
    "\nReason: '" . htmlspecialchars($r->faultString()).'\'

'; } ?> $Id$ \ No newline at end of file + xmlrpc

Agesort demo

Send an array of 'name' => 'age' pairs to the server that will send it back sorted.

The source code demonstrates basic lib usage, including handling of xmlrpc arrays and structs

24, "Edd" => 45, "Joe" => 37, "Fred" => 27); reset($inAr); print "This is the input data:
";
while (list($key, $val)=each($inAr)) {
  print $key . ", " . $val . "\n";
}
print "
"; // create parameters from the input array: an xmlrpc array of xmlrpc structs $p=array(); foreach($inAr as $key => $val) { $p[]=new xmlrpcval(array("name" => new xmlrpcval($key), "age" => new xmlrpcval($val, "int")), "struct"); } $v=new xmlrpcval($p, "array"); print "Encoded into xmlrpc format it looks like this:
\n" .  htmlentities($v->serialize()). "
\n"; // create client and message objects $f=new xmlrpcmsg('examples.sortByAge', array($v)); $c=new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80); // set maximum debug level, to have the complete communication printed to screen $c->setDebug(2); // send request print "Now sending request (detailed debug info follows)"; $r=&$c->send($f); // check response for errors, and take appropriate action if (!$r->faultCode()) { print "The server gave me these results:
";
  $v=$r->value();
  $max=$v->arraysize();
  for($i=0; $i<$max; $i++) {
    $rec=$v->arraymem($i);
    $n=$rec->structmem("name");
    $a=$rec->structmem("age");
    print htmlspecialchars($n->scalarval()) . ", " . htmlspecialchars($a->scalarval()) . "\n";
  }

  print "
For nerds: I got this value back
" .
    htmlentities($r->serialize()). "

\n"; } else { print "An error occurred:
";
  print "Code: " . htmlspecialchars($r->faultCode()) .
    "\nReason: '" . htmlspecialchars($r->faultString()).'\'

'; } ?> \ No newline at end of file diff --git a/demo/client/client.php b/demo/client/client.php index b5ec001..94b61ff 100644 --- a/demo/client/client.php +++ b/demo/client/client.php @@ -48,7 +48,5 @@

Enter a state number to query its name

"; ?> -
-$Id$ diff --git a/demo/client/comment.php b/demo/client/comment.php index 7133cf9..5659fa1 100644 --- a/demo/client/comment.php +++ b/demo/client/comment.php @@ -180,6 +180,6 @@ if (@$_GET["comment"] && src="http://meerkat.oreillynet.com/icons/meerkat-powered.jpg" height="31" width="88" alt="Meerkat powered, yeah!" border="0" hspace="8" /> -$Id$

+

diff --git a/demo/client/introspect.php b/demo/client/introspect.php index 818e04c..55dec8a 100644 --- a/demo/client/introspect.php +++ b/demo/client/introspect.php @@ -1,108 +1 @@ - -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"; - } - } - } -?> -
-$Id$ - - + 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 diff --git a/demo/client/mail.php b/demo/client/mail.php index f73ed37..5f0916c 100644 --- a/demo/client/mail.php +++ b/demo/client/mail.php @@ -65,7 +65,5 @@ Subject Body
-
-$Id$ diff --git a/demo/client/which.php b/demo/client/which.php index 0699c8b..8b1ba48 100644 --- a/demo/client/which.php +++ b/demo/client/which.php @@ -1,32 +1 @@ - -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"; - } -?> -
-$Id$ - - + 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 diff --git a/demo/client/wrap.php b/demo/client/wrap.php index 6b4e005..458f668 100644 --- a/demo/client/wrap.php +++ b/demo/client/wrap.php @@ -52,7 +52,5 @@ } } ?> -
-$Id$ diff --git a/demo/client/zopetest.php b/demo/client/zopetest.php index 1029e01..7ecfeb5 100644 --- a/demo/client/zopetest.php +++ b/demo/client/zopetest.php @@ -25,7 +25,5 @@ . " Reason: '" . ($r->faultString()) . "'
"; } ?> -
-$Id$ -- 2.43.0