function findState($m)
{
global $stateNames;
+
$err = "";
// get the first param
$sno = $m->getParam(0);
function inner_findstate($stateNo)
{
global $stateNames;
+
if (isset($stateNames[$stateNo - 1])) {
return $stateNames[$stateNo - 1];
} else {
function stringEcho($m)
{
// just sends back a string
- $s = $m->getParam(0);
- $v = $s->scalarval();
-
- return new PhpXmlRpc\Response(new Value($s->scalarval()));
+ return new PhpXmlRpc\Response(new Value($m->getParam(0)->scalarval()));
}
$echoback_sig = array(array(Value::$xmlrpcString, Value::$xmlrpcString));
$echosixtyfour_doc = 'Accepts a base64 parameter and returns it decoded as a string';
function echoSixtyFour($m)
{
- // accepts an encoded value, but sends it back
- // as a normal string. this is to test base64 encoding
- // is working as expected
+ // Accepts an encoded value, but sends it back as a normal string.
+ // This is to test that base64 encoding is working as expected
$incoming = $m->getParam(0);
return new PhpXmlRpc\Response(new Value($incoming->scalarval(), "string"));
Value::$xmlrpcString, Value::$xmlrpcString, Value::$xmlrpcString,
Value::$xmlrpcString, Value::$xmlrpcString,
));
-
$mailsend_doc = 'mail.send(recipient, subject, text, sender, cc, bcc, mimetype)<br/>
recipient, cc, and bcc are strings, comma-separated lists of email addresses, as described above.<br/>
subject is a string, the subject of the message.<br/>
"docstring" => $bitflipper_doc,
),
// signature omitted on purpose
- "examples.generatePHPWarning" => array(
+ "tests.generatePHPWarning" => array(
"function" => array($object, "phpWarningGenerator"),
),
// signature omitted on purpose
- "examples.raiseException" => array(
+ "tests.raiseException" => array(
"function" => array($object, "exceptionGenerator"),
),
+ // Greek word 'kosme'. NB: NOT a valid ISO8859 string!
+ // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods
+ "tests.utf8methodname." . 'κόσμε' => array(
+ "function" => "stringEcho",
+ "signature" => $stringecho_sig,
+ "docstring" => $stringecho_doc,
+ ),
+ /*"tests.iso88591methodname." . chr(224) . chr(252) . chr(232) => array(
+ "function" => "stringEcho",
+ "signature" => $stringecho_sig,
+ "docstring" => $stringecho_doc,
+ ),*/
"examples.getallheaders" => array(
"function" => 'getallheaders_xmlrpc',
"signature" => $getallheaders_sig,