The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dokuwiki::Frontier::Client - A Frontier::Client for dokuwiki.

SYNOPSIS

Dokuwiki::Frontier::Client extends the Frontier::Client with the Dokuwiki XML-RPC methods (without namespace) described in the dokuwiki xml-rpc page.

so the call to the wiki.getAllPages (which also require a call to dokuwiki.login) is like:

    use Dokuwiki::Frontier::Client;
    use YAML ();

    my $client = Dokuwiki::Frontier::Client->base('https://di.u-strasbg.fr/')
        or die;

    $client->login('editor','s3cr3t')
        or die; 

    print YAML::Dump [ $client->getAllPages ];

CONSTRUCTORS

Note that base is just a shortcut for new. those constructions are equivalent:

    Dokuwiki::Frontier::Client->base('https://di.u-strasbg.fr/');
    Dokuwiki::Frontier::Client->base(url => 'https://di.u-strasbg.fr/');
    Dokuwiki::Frontier::Client->new(url => 'https://di.u-strasbg.fr/lib/exe/xmlrpc.php' );

METHODS, INTROSPECTION

%Dokuwiki::Frontier::Client::API is a hash where keys are the Dokuwiki::Frontier::Client methods and values are the Dokuwiki XML-RPC methods. So you can have the list of the mapped functions with:

    perl -MDokuwiki::Frontier::Client -E'say for keys %Dokuwiki::Frontier::Client::API'

but please refer to the dokuwiki xml-rpc page for more details.

A REAL WORLD EXAMPLE

    use Dokuwiki::Frontier::Client;
    use Modern::Perl;
    use Net::Netrc;
    use YAML;

    my $base = 'https://example.com/';
    my $host = 'server.example.com';

    my $wiki = Dokuwiki::Frontier::Client->base
        ( $host , debug => 1 );

    my $credentials = Net::Netrc->lookup($host)
        or die "please add a fake $host machine in your ~/.netrc";

    $wiki->login( ($credentials->lpa)[0,1] )
        or die "can't authenticate";

    say YAML::Dump [$wiki->getPage('/ficheappli/start')];