Hossain Khan
Hossain Khan

Reputation: 6452

Using PHP to manage(add/edit/update) Trac via XML-RPC - Sample code/Tutorial?

I know there exists xml-rpc plugin for Trac (http://trac-hacks.org/wiki/XmlRpcPlugin), but I was wondering if anybody knows any example/tutorial for using xml-rpc PHP client to update Trac infos.

Thanks

Upvotes: 2

Views: 1335

Answers (1)

Till
Till

Reputation: 22408

The last time I used XmlRpc, I used Zend_XmlRpc_Client. Here is one of the examples translated from Python to PHP (using Zend_XmlRpc_Client):

The trac runs on localhost:

<?php
require_once 'Zend/XmlRpc/Client.php';

$client = new Zend_XmlRpc_Client("http://user:pass@localhost/login/xmlrpc");
$trac   = $client->getProxy();
echo $trac->getPage('WikiStart');
echo $trac->getPageHTML('WikiStart');

Does that get you started?

Upvotes: 1

Related Questions