aboutsummaryrefslogtreecommitdiff
path: root/plugins/externaldemo
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-09-29 13:35:30 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-09-29 13:35:30 -0400
commitac8ecdcf68b89544d126032718e225add0a09238 (patch)
treedc5f4f046cb59fe37942e0e8340dbd5251e20927 /plugins/externaldemo
parent1f929e7f6404dc260ebd7818c83ca87e52da6c41 (diff)
downloadikiwiki-ac8ecdcf68b89544d126032718e225add0a09238.tar
ikiwiki-ac8ecdcf68b89544d126032718e225add0a09238.tar.gz
Support RPC::XML 0.69's incompatable object instantiation method.
Diffstat (limited to 'plugins/externaldemo')
-rwxr-xr-xplugins/externaldemo15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/externaldemo b/plugins/externaldemo
index be7aba8b9..24861dcc9 100755
--- a/plugins/externaldemo
+++ b/plugins/externaldemo
@@ -8,7 +8,6 @@ use strict;
print STDERR "externaldemo plugin running as pid $$\n";
use RPC::XML;
-use RPC::XML::Parser;
use IO::Handle;
# autoflush stdout
@@ -31,7 +30,19 @@ sub rpc_read {
$accum=$2; # the rest
# Now parse the XML RPC.
- my $r = RPC::XML::Parser->new->parse($1);
+ my $parser;
+ eval q{
+ use RPC::XML::ParserFactory;
+ $parser = RPC::XML::ParserFactory->new;
+ };
+ if ($@) {
+ # old interface
+ eval q{
+ use RPC::XML::Parser;
+ $parser = RPC::XML::Parser->new;
+ };
+ }
+ my $r=$parser->parse($1);
if (! ref $r) {
die "error: XML RPC parse failure $r";
}