test.pl.svn-base

来自「PHP 知识管理系统(基于树结构的知识管理系统), 英文原版的PHP源码。」· SVN-BASE 代码 · 共 53 行

SVN-BASE
53
字号
#!/usr/local/bin/perluse Frontier::Client;my $serverURL='http://phpxmlrpc.sourceforge.net/server.php';# try the simplest examplemy $client = Frontier::Client->new( 'url' => $serverURL,		'debug' => 0, 'encoding' => 'iso-8859-1' );my $resp = $client->call("examples.getStateName", 32);print "Got '${resp}'\n";# now send a mail to nobody in particular$resp = $client->call("mail.send", ("edd", "Test",  	"Bonjour. Je m'appelle G閞ard. Ma馻na. ", "freddy", "", "", 	'text/plain; charset="iso-8859-1"'));if ($resp->value()) {	print "Mail sent OK.\n";} else {	print "Error sending mail.\n";}# test echoing of characters works fine$resp = $client->call("examples.echo", 'Three "blind" mice - ' . 	"See 'how' they run");print $resp . "\n";# test name and age example. this exercises structs and arrays $resp = $client->call("examples.sortByAge", 											[ { 'name' => 'Dave', 'age' => 35},												{ 'name' => 'Edd', 'age' => 45 },												{ 'name' => 'Fred', 'age' => 23 },												{ 'name' => 'Barney', 'age' => 36 } ] );my $e;foreach $e (@$resp) {	print $$e{'name'} . ", " . $$e{'age'} . "\n";}# test base64$resp = $client->call("examples.decode64", 											$client->base64("TWFyeSBoYWQgYSBsaXR0bGUgbGFtYiBTaGUgd" .																			"GllZCBpdCB0byBhIHB5bG9u"));print $resp . "\n";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?