*/
class xmlrpc_server_methods_container
{
- /*
+ /**
* Method used to test logging of php warnings generated by user functions.
*/
function phpwarninggenerator($m)
return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
}
+ /**
+ * Method used to testcatching of exceptions in the server.
+ */
+ function exceptiongenerator($m)
+ {
+ throw new Exception("it's just a test", 1);
+ }
+
/**
* a PHP version of the state-number server. Send me an integer and i'll sell you a state
* @param integer $s
* @return string
- * */
+ */
static function findstate($s)
{
return inner_findstate($s);
$findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
- $obj = new xmlrpc_server_methods_container();
+ $findstate5_sig = wrap_php_function('xmlrpc_server_methods_container::findstate');
+ $obj = new xmlrpc_server_methods_container();
$findstate4_sig = wrap_php_function(array($obj, 'findstate'));
$addtwo_sig=array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt));
"function" => array($o, "phpwarninggenerator")
//'function' => 'xmlrpc_server_methods_container::phpwarninggenerator'
),
+ "examples.raiseException" => array(
+ "function" => array($o, "exceptiongenerator")
+ ),
"examples.getallheaders" => array(
"function" => 'getallheaders_xmlrpc',
"signature" => $getallheaders_sig,
if ($findstate4_sig)
$a['examples.php3.getStateName'] = $findstate4_sig;
+ if ($findstate5_sig)
+ $a['examples.php4.getStateName'] = $findstate5_sig;
+
$s=new xmlrpc_server($a, false);
$s->setdebug(3);
$s->compress_response = true;
// we do this to help the testsuite script: do not reproduce in production!
if (isset($_GET['RESPONSE_ENCODING']))
$s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
-
+ if (isset($_GET['EXCEPTION_HANDLING']))
+ $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
$s->service();
// that should do all we need!
?>
\ No newline at end of file