(no commit message)
[paste/16.git] / phork0.rst
1 Client\r
2 ======\r
3 - send pingback for given URL to remote URL\r
4 - use HTTP_Request2, since it allows to use curl if available and others if not\r
5 \r
6 ::\r
7 \r
8  $pc = new Pingback_Client();\r
9  $pc->send($myUrl, $targetUrl);\r
10 \r
11 TODO: error handling. exceptions? simply true/false with $pc->getError()?\r
12 \r
13 Server\r
14 ======\r
15 - register custom handler\r
16 - register custom validator\r
17 - provide basic backlinking validator\r
18 \r
19 ::\r
20 \r
21  $ps = new Pingback_Server();\r
22  $ps->registerHandler(array($datastore, 'storePingback'));\r
23  $ps->registerValidator(array($pingbackValidator, 'checkBlogAge'));\r
24  $ps->registerValidator(array($pingbackValidator, 'checkFriendliness'));\r
25  $ps->run();\r
26 \r
27 \r
28 My Solution\r
29 ===========\r
30 https://github.com/pear2/Services_Linkback\r
31 \r
32 \r
33 Existing libraries\r
34 ==================\r
35 \r
36 - http://pear.php.net/package/Services_Pingback\r
37 \r
38   - bad: uses outdated libraries (HTTP_Request v1, XML_RPC v1, Net_URL v1), not E_STRICT compliant\r
39 \r
40 - https://github.com/tedeh/pingback-php\r
41 \r
42   - bad: "Client" (Utility) has no state thus has to re-fetch the remote files again and again (isPingbackEnabled, getPingbackServerURL, isBacklinking)\r
43   - you have to extend the server to properly use it\r
44   - no examples\r
45 \r
46 - https://github.com/driedfruit/php-pingback\r
47 \r
48   - bad: bunch of functions\r
49 \r
50 - Zend Framework 1 has nothing\r
51 \r
52   - there was a proposal, Zend_Service_Linkback, but it was not finished/included: http://framework.zend.com/wiki/pages/viewpage.action?pageId=13107298\r
53   - http://www.zendframeworkmagazin.de/zf/blog/pingback-mit-dem-zend-framework-1