PHPackages                             pear2/services\_linkback - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. pear2/services\_linkback

ActiveLibrary[API Development](/categories/api)

pear2/services\_linkback
========================

Pingback+webmention client and server implementation

v0.4.0(3y ago)91163[1 issues](https://github.com/pear2/Services_Linkback/issues)LGPL-3.0+PHP

Since Jul 12Pushed 3y ago11 watchersCompare

[ Source](https://github.com/pear2/Services_Linkback)[ Packagist](https://packagist.org/packages/pear2/services_linkback)[ Docs](http://pear2.php.net/PEAR2_Services_Linkback)[ RSS](/packages/pear2-services-linkback/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

PEAR2 Services\_Linkback
========================

[](#pear2-services_linkback)

[Pingback](http://hixie.ch/specs/pingback/pingback) and [webmention](http://webmention.net/) client and server implementation for PHP 5.3+.

Contents

- [Linkback server](#linkback-server)
    - [Glossary](#glossary)
    - [Customization via callbacks](#customization-via-callbacks)
        - [Services\\Linkback\\Server\\Callback\\ITarget](#services-linkback-server-callback-itarget)
        - [Services\\Linkback\\Server\\Callback\\ISource](#services-linkback-server-callback-isource)
        - [Services\\Linkback\\Server\\Callback\\ILink](#services-linkback-server-callback-ilink)
        - [Services\\Linkback\\Server\\Callback\\IStorage](#services-linkback-server-callback-istorage)
        - [TODO](#todo)
- [Linkback client](#linkback-client)
- [Installation](#installation)
- [About Services\_Linkback](#about-services-linkback)

[Linkback server](#id4)
-----------------------

[](#linkback-server)

The package provides a basic pingback+webmention server implementation that can be customized easily via callbacks.

Usage:

```
$srv = new \PEAR2\Services\Linkback\Server();
$srv->addCallback(new PingbackLogger());
$srv->run();
```

### [Glossary](#id5)

[](#glossary)

source URLRemote URL that links to the local target URLtarget URLLocal URL that gets linked by the source URL### [Customization via callbacks](#id6)

[](#customization-via-callbacks)

The server provides 4 types of callbacks to modify its behaviour. Each callback needs to implement one of the four interfaces:

#### [Services\\Linkback\\Server\\Callback\\ITarget](#id7)

[](#serviceslinkbackservercallbackitarget)

Verifies that the target URL exists in the local system. Useful to filter out pingbacks for non-existant URLs.

FIXME: Default implementation

#### [Services\\Linkback\\Server\\Callback\\ISource](#id8)

[](#serviceslinkbackservercallbackisource)

Fetches the source URL for further verification. Used to determine if the source URL really exists.

Services\_Pingback provides the `Services\Linkback\Server\Callback\FetchSource`callback class that is automatically registered with the server.

#### [Services\\Linkback\\Server\\Callback\\ILink](#id9)

[](#serviceslinkbackservercallbackilink)

Verifies that the source URL content really links to the target URL. Used to filter out fake pingbacks that do not actually provide links.

Services\_Pingback provides the `Services\Linkback\Server\Callback\LinkExists`callback class that is automatically registered with the server.

#### [Services\\Linkback\\Server\\Callback\\IStorage](#id10)

[](#serviceslinkbackservercallbackistorage)

After all verifications have been done, the storage finally handles the pingback - it could e.g. log it to a file or a database.

Services\_Pingback does not provide a default storage implementation; you have to write it yourself.

#### [TODO](#id11)

[](#todo)

See what we can learn from

[Linkback client](#id12)
------------------------

[](#linkback-client)

Tell someone that you linked to him:

```
$from = 'http://my-blog.example.org/somepost.html';
$to   = 'http://b.example.org/inspiration.html';
$lbc  = new \PEAR2\Services\Linkback\Client();
$lbc->send($from, $to);
```

You can adjust the HTTP\_Request2 settings:

```
$req = $lbc->getRequest();
$req->setConfig(
    array(
        'ssl_verify_peer' => false,
        'ssl_verify_host' => false
    )
);
$lbc->setRequestTemplate($req);
```

And change the user agent header sent with the linkback requests:

```
$req = $lbc->getRequest();
$headers = $req->getHeaders();
$req->setHeader('user-agent', 'my blog engine');
$lbc->setRequestTemplate($req);
```

And a debug mode is available, too:

```
$lbc->setDebug(true);
```

This setting stores HTTP responses for later inspection.

[Installation](#id13)
---------------------

[](#installation)

Using composer:

```
$ composer require pear2/services_linkback
```

[About Services\_Linkback](#id14)
---------------------------------

[](#about-services_linkback)

Services\_Linkback was written by [Christian Weiske](http://cweiske.de/)and is licensed under the [LGPLv3 or later](https://www.gnu.org/licenses/lgpl-3.0.html).

Homepage[http://pear2.php.net/PEAR2\_Services\_Linkback](http://pear2.php.net/PEAR2_Services_Linkback)Bug tracker[https://github.com/pear2/Services\_Linkback/issues](https://github.com/pear2/Services_Linkback/issues)DocumentationThe [examples/](https://github.com/pear2/Services_Linkback/tree/master/examples) folder.Packagist[https://packagist.org/packages/pear2/services\_linkback](https://packagist.org/packages/pear2/services_linkback)Unit test status[https://travis-ci.org/pear2/Services\_Linkback](https://travis-ci.org/pear2/Services_Linkback)

[![https://travis-ci.org/pear2/Services_Linkback.svg?branch=master](https://camo.githubusercontent.com/7a86389ce650f30e93dbb38270600a4d483d21d8c3eecbc7a2dfca158d05e24f/68747470733a2f2f7472617669732d63692e6f72672f70656172322f53657276696365735f4c696e6b6261636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pear2/Services_Linkback)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1588 days

Total

3

Last Release

1153d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1323714f58f9144af310e5e4217e61b96ad7c42bc5c93a1f2d97deca95f6f4f8?d=identicon)[ashnazg](/maintainers/ashnazg)

![](https://www.gravatar.com/avatar/a1a2e6fe03f91204de2117430a748a12db2957eb113d4a50fc86d68d3c851e11?d=identicon)[cweiske](/maintainers/cweiske)

---

Top Contributors

[![cweiske](https://avatars.githubusercontent.com/u/59036?v=4)](https://github.com/cweiske "cweiske (98 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pear2-services-linkback/health.svg)

```
[![Health](https://phpackages.com/badges/pear2-services-linkback/health.svg)](https://phpackages.com/packages/pear2-services-linkback)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
