merge upstream phpxmlrpc
[plcapi.git] / php / phpxmlrpc / demo / client / agesort.php
index 90622d2..9ad397f 100644 (file)
@@ -1,4 +1,4 @@
-<html>
+<?php require_once __DIR__ . "/_prepend.php"; ?><html lang="en">
 <head><title>xmlrpc - Agesort demo</title></head>
 <body>
 <h1>Agesort demo</h1>
@@ -7,20 +7,17 @@
 
 <h3>The source code demonstrates basic lib usage, including handling of xmlrpc arrays and structs</h3>
 
-<p></p>
+<p>You can see the source to this page here: <a href="agesort.php?showSource=1">agesort.php</a></p>
 <?php
 
-include_once __DIR__ . "/../../src/Autoloader.php";
-PhpXmlRpc\Autoloader::register();
-
 $inAr = array("Dave" => 24, "Edd" => 45, "Joe" => 37, "Fred" => 27);
 print "This is the input data:<br/><pre>";
-foreach($inAr as $key => $val) {
+foreach ($inAr as $key => $val) {
     print $key . ", " . $val . "\n";
 }
 print "</pre>";
 
-// create parameters from the input array: an xmlrpc array of xmlrpc structs
+// Create parameters from the input array: an xmlrpc array of xmlrpc structs
 $p = array();
 foreach ($inAr as $key => $val) {
     $p[] = new PhpXmlRpc\Value(
@@ -36,7 +33,7 @@ print "Encoded into xmlrpc format it looks like this: <pre>\n" . htmlentities($v
 
 // create client and message objects
 $req = new PhpXmlRpc\Request('examples.sortByAge', array($v));
-$client = new PhpXmlRpc\Client("http://phpxmlrpc.sourceforge.net/server.php");
+$client = new PhpXmlRpc\Client(XMLRPCSERVER);
 
 // set maximum debug level, to have the complete communication printed to screen
 $client->setDebug(2);
@@ -65,4 +62,4 @@ if (!$resp->faultCode()) {
 
 ?>
 </body>
-</html>
+</html><?php require_once __DIR__ . "/_append.php"; ?>