aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
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 /IkiWiki
parent1f929e7f6404dc260ebd7818c83ca87e52da6c41 (diff)
downloadikiwiki-ac8ecdcf68b89544d126032718e225add0a09238.tar
ikiwiki-ac8ecdcf68b89544d126032718e225add0a09238.tar.gz
Support RPC::XML 0.69's incompatable object instantiation method.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/external.pm21
1 files changed, 16 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm
index 0d292dfc2..ec91c79db 100644
--- a/IkiWiki/Plugin/external.pm
+++ b/IkiWiki/Plugin/external.pm
@@ -8,7 +8,6 @@ use warnings;
use strict;
use IkiWiki 3.00;
use RPC::XML;
-use RPC::XML::Parser;
use IPC::Open2;
use IO::Handle;
@@ -55,7 +54,19 @@ sub rpc_call ($$;@) {
$plugin->{accum}.=$_;
while ($plugin->{accum} =~ /^\s*(<\?xml\s.*?<\/(?:methodCall|methodResponse)>)\n(.*)/s) {
$plugin->{accum}=$2;
- 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);
error("XML RPC parser failure: $r") unless ref $r;
if ($r->isa('RPC::XML::response')) {
my $value=$r->value;
@@ -72,9 +83,9 @@ sub rpc_call ($$;@) {
# XML-RPC v1 does not allow for
# nil/null/None/undef values to be
- # transmitted, so until
- # XML::RPC::Parser honours v2
- # (<nil/>), external plugins send
+ # transmitted. The <nil/> extension
+ # is the right fix, but for
+ # back-compat, let external plugins send
# a hash with one key "null" pointing
# to an empty string.
if (exists $hash{null} &&