use strict;
use IkiWiki 3.00;
use RPC::XML;
-use RPC::XML::Parser;
use IPC::Open2;
use IO::Handle;
$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;
# 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} &&
* img: Fix dependency code for full size images.
* toggle, relativedate: Support templates that add attributes
to the body tag.
+ * Support RPC::XML 0.69's incompatable object instantiation method.
-- Joey Hess <joeyh@debian.org> Sun, 27 Sep 2009 17:40:03 -0400
print STDERR "externaldemo plugin running as pid $$\n";
use RPC::XML;
-use RPC::XML::Parser;
use IO::Handle;
# autoflush stdout
$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";
}