merge upstream phpxmlrpc
[plcapi.git] / php / phpxmlrpc / demo / client / proxy.php
index 7173db0..9b7fce6 100644 (file)
@@ -1,14 +1,12 @@
-<html>
+<?php require_once __DIR__ . "/_prepend.php"; ?><html lang="en">
 <head><title>xmlrpc - Proxy demo</title></head>
 <body>
 <h1>proxy demo</h1>
 <h2>Query server using a 'proxy' object</h2>
 <h3>The code demonstrates usage for the terminally lazy. For a more complete proxy, look at at the Wrapper class</h3>
+<p>You can see the source to this page here: <a href="proxy.php?showSource=1">proxy.php</a></p>
 <?php
 
-include_once __DIR__ . "/../../src/Autoloader.php";
-PhpXmlRpc\Autoloader::register();
-
 class PhpXmlRpcProxy
 {
     protected $client;
@@ -31,7 +29,7 @@ class PhpXmlRpcProxy
      *
      * @throws Exception
      */
-    function __call($name, $arguments)
+    public function __call($name, $arguments)
     {
         $encoder = new PhpXmlRpc\Encoder();
         $valueArray = array();
@@ -50,11 +48,12 @@ class PhpXmlRpcProxy
             return $resp->value();
         }
     }
-
 }
 
 $stateNo = rand(1, 51);
-$proxy = new PhpXmlRpcProxy(new \PhpXmlRpc\Client('http://phpxmlrpc.sourceforge.net/server.php'));
+$proxy = new PhpXmlRpcProxy(new PhpXmlRpc\Client(XMLRPCSERVER));
 $stateName = $proxy->getStateName($stateNo);
 
-echo "State $stateNo is ".htmlspecialchars($stateName);
\ No newline at end of file
+echo "State $stateNo is ".htmlspecialchars($stateName);
+
+require_once __DIR__ . "/_append.php";