[pmwiki-users] Experimental Pingback recipe, open issues

Stefan Schimanski sts at 1stein.org
Tue Sep 26 09:37:38 CDT 2006


I am currently experimenting with an implementation of the Pingback
protocol (see [1] and [2] in PmWiki. It more or less works, but I still
have some problems, maybe somebody knows how to deal with it.

The basic idea is that I install an EditFunction which registers a
shutdown function in PHP which will later on ping all external sites
which are referenced in the edited page. This is the client part of the
Pingback chain and it's obviously implemented as a recipe (see [4]).

It works more or less, only that I get a "premature end of output" error
From the CGI version of PHP sometimes. I guess it's some kind of
timeout, but it already appears after maybe 5 seconds. Don't know how to
deal with it. Though the script (pings) works fine.

The second component is the XML RPC server script (see [5] for the
code). It gets a pair of URLs, the source and the target. The target is
an URL to a page in your site, the source is the source page of the

So first one has to extract the pagename from the target url. That's not
trivial as the URL layout may change depending on the installation,
e.g. rewrite rules in htaccess, clean urls and so on. So I guess there
is no way for a proper general way to map back urls to pagenames. I
thought about putting a "%comment% pagename={$FullName}" into the page
which would give this mapping. But this doesn't look clean either
(another page call for every ping...).

Second one has to somehow handle the ping. My current implementation
appends a line to the Pingback.{$Group}-{$Name} page. For that of course
I have to load PmWiki, but without output. I am using the
ob_start()/ob_end_clean() function for that, looks like a hack. This
seems really to be ugly. Is there a nicer way to change a wiki page from
"outside"? Maybe could there be a way to use PmWiki like a library? That
would help here (and maybe in many other applications... somebody
mentioned access to PmWiki via a shell script).

Moreover I want that the notify mechanism works. So a pair of
ReadPage/WritePage doesn't do the job. Am I right that the UpdatePage
function which was mentioned for the future will solve this problem?


[1] http://en.wikipedia.org/wiki/Pingback
[2] http://www.hixie.ch/specs/pingback/pingback
[3] http://pear.php.net/package/Services_Pingback/
[5] https://skizzle.de/websvn/filedetails.php?repname=sschimanski&path=%2Fpmwiki%2Fcookbook%2Fpingback_server.php&rev=0&sc=0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20060926/d4a0b01d/attachment.bin 

More information about the pmwiki-users mailing list