From: Arnaud F. <ar...@cr...> - 2005-01-09 17:17:11
|
Still seeking and trying ... Well ... even the createRevision doesn't work ... Here is the code : /** Int putPage(String pagename, String content) * */ $wiki_dmap['putPage'] = array('signature' => array(array($xmlrpcString,$xmlrpcString,$xmlrpcString)), 'documentation' => 'put the raw Wiki text of a new version of a page', 'function' => 'putPage'); function putPage($params) { global $request; $ParamPageName = $params->getParam(0); $ParamContent = $params->getParam(1); $pagename = short_string_decode($ParamPageName->scalarval()); $content = short_string_decode($ParamContent->scalarval()); $dbh = $request->getDbh(); $page = $dbh->getPage($pagename); $current = $page->getCurrentRevision(); $meta = $current->_data; $meta['summary'] = "XML-RPC Wiki Contrib"; $version = $current->getVersion(); //$res = $page->save($content, $version + 1, $meta); $formatted = new TransformedText($page, $content, $meta); $type = $formatted->getType(); $meta['pagetype'] = $type->getName(); $links = $formatted->getWikiPageLinks(); $version = $version +1; $res = $page->createRevision($version, $content, $meta, $links); if ($res) $message = "Page $pagename version $version created"; else $message = "Problem creating version $version of page $pagename"; return new xmlrpcresp(short_string($message)); } One more info : it seems to lock the DB ... I have to restart apache to access the wiki again (and only this one, not others ... got plenty running on my server). Arnaud Fontaine a écrit : > Hi all, > > I wrote a putPage Xml-Rpc method for version 1.3.4 ... it was working > perfectly and took the authentification from http ... > > I'm writing another one for version 1.3.7 ... it crashes when running > the $page->save method ... and I don't know how manage authentification. > > The 1.3.4 putPage was using the $page->createRevision method. > > Any clue ? > > Oh ... btw, if you have any good idea to debug xml-rpc methods ... -- Arnaud Fontaine CRAO Jabber: sh...@ra... |