2 require_once("./JSON.php");
4 // FIXME: doesn't look like we really need Pear at all
5 // which decreases the testing burden.
6 // Commenting out.the require and the new File() call.
8 // NOTE: File.php is installed via Pear using:
9 // %> sudo pear install File
10 // Your server will also need the Pear library directory included in PHP's
11 // include_path configuration directive
12 // require_once('File.php');
14 // ensure that we don't try to send "html" down to the client
15 header("Content-Type: text/plain");
17 $json = new Services_JSON;
21 $results['error'] = null;
23 $jsonRequest = file_get_contents('php://input');
24 //$jsonRequest = '{"params":["Blah"],"method":"myecho","id":86}';
26 $req = $json->decode($jsonRequest);
28 include("./testClass.php");
29 $testObject = new testClass();
31 $method = $req->method;
32 if ($method != "triggerRpcError") {
33 $ret = call_user_func_array(array($testObject,$method),$req->params);
34 $results['result'] = $ret;
36 $results['error'] = "Triggered RPC Error test";
38 $results['id'] = $req->id;
40 $encoded = $json->encode($results);