X-Git-Url: https://git.cweiske.de/stapibas.git/blobdiff_plain/f1d0e15e87c0e2c1f0d73f4a4b12780e974932f0..691e371946c32283206b15600dd09f9464819870:/www/xmlrpc.php diff --git a/www/xmlrpc.php b/www/xmlrpc.php index baaceea..52bdf6e 100644 --- a/www/xmlrpc.php +++ b/www/xmlrpc.php @@ -22,8 +22,8 @@ function __autoload($className) $db = new PDO($dbdsn, $dbuser, $dbpass); class PingbackStorage - implements \PEAR2\Services\Pingback2\Server_Callback_IStorage, - \PEAR2\Services\Pingback2\Server_Callback_ILink + implements \PEAR2\Services\Pingback\Server\Callback\IStorage, + \PEAR2\Services\Pingback\Server\Callback\ILink { public function __construct(PDO $db) { @@ -51,6 +51,7 @@ class PingbackStorage ) ); } + /** * Verifies that a link from $source to $target exists. * @@ -70,7 +71,27 @@ class PingbackStorage } } -$s = new \PEAR2\Services\Pingback2\Server(); +class PingbackMailer + implements \PEAR2\Services\Pingback\Server\Callback\IStorage +{ + public function storePingback( + $target, $source, $sourceBody, \HTTP_Request2_Response $res + ) { + mail( + 'cweiske@cweiske.de', + 'New pingback', + "A pingback just came in, for\n" + . '> ' . $target . "\n" + . "from\n" + . '> ' . $source . "\n" + . "\n\nLove, stapibas", + "From: stapibas " + ); + } +} + +$s = new \PEAR2\Services\Pingback\Server(); $s->addCallback(new PingbackStorage($db)); +$s->addCallback(new PingbackMailer()); $s->run(); ?>