PHPackages                             tedeh/pingback - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. tedeh/pingback

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

tedeh/pingback
==============

Pingback client and server implementation

1.3.2(13y ago)279012[1 issues](https://github.com/tedeh/pingback-php/issues)MITPHPPHP &gt;=5.0.0

Since May 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tedeh/pingback-php)[ Packagist](https://packagist.org/packages/tedeh/pingback)[ Docs](https://github.com/tedeh/pingback-php)[ RSS](/packages/tedeh-pingback/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Pingback implementation for PHP
===============================

[](#pingback-implementation-for-php)

Created and copyrighted by [Tedde Lundgren](mailto:mail@tedeh.net) and licensed under MIT.

Introduction
------------

[](#introduction)

Pingbacks, quoting Wikipedia, are "one of three types of linkbacks, methods for Web authors to request notification when somebody links to one of their documents". More precisely, an explicitly defined procedure based on XML-RPC that enable web applications (typically blogs) to communicate about links.

This library was built to comply with [the official pingback specification](http://hixie.ch/specs/pingback/pingback-1.0) and supports both the sending and the reception of pingback requests.

Requirements
------------

[](#requirements)

Requirements center around libraries commonly available in PHP5.

- PHP &gt;= 5
- cURL ()
- XML-RPC ()
- Document Object Model ()

Usage and notes on implementation
=================================

[](#usage-and-notes-on-implementation)

Overview
--------

[](#overview)

The library consists of three classes.

- **Pingback\_Server** manages the server and composite validation of requests
- **Pingback\_Utility** provides a set of static methods to aid the server and enable the client
- **Pingback\_Exception** is the class that exceptions thrown by the library will be of

Pingback\_Utility
-----------------

[](#pingback_utility)

Pingback\_Utility contains the following static methods.

### Pingback\_Utility::isURL()

[](#pingback_utilityisurl)

- `@param string $url` The URL
- `@return boolean` Wheter the URL is valid

Returns a boolean value determining wheter the first argument is a valid URL or not.

### Pingback\_Utility::isPingbackEnabled()

[](#pingback_utilityispingbackenabled)

- `@param string $url` The URL
- `@return boolean` Wheter the URL is pingback enabled

Returns a boolean value determining wheter the first argument supports the reception of pingbacks.

### Pingback\_Utility::getRawPostData()

[](#pingback_utilitygetrawpostdata)

- `@return string` The raw POST data

Reads the raw, unfiltered POST data and returns it

### Pingback\_Utility::getPingbackURL()

[](#pingback_utilitygetpingbackurl)

- `@param string @url` The URL
- `@return string` The server address if found

Extracts the pingback URL from the first argument.

### PingbackUtility::isBacklinking()

[](#pingbackutilityisbacklinking)

- `@param string $from` The URL of the page
- `@param string $to` The URL that should exist in atleast one link
- `@return boolean` Wheter there is a link or not

Determines wheter the first argument is linking to the second.

### PingbackUtility::sendPingback()

[](#pingbackutilitysendpingback)

- `@param string $from` The originator of the pingback
- `@param string $to` The target of the pingback
- `@param string $server` The URL of the server
- `@return string` The raw response from the server

The client implementation. Takes three arguments. The first one is the source URL (originator) of the pingback request, the second one is the target url, and the third one is the url to the pingback server. Returns the raw server response, which is easily parsed with `xmlrpc_decode_request()`.

Pingback\_Server
----------------

[](#pingback_server)

PingbackServer is an instantiable class representing a pingback server resource. The majority of requirements put upon a valid pingback request are automatically evaluated. However, two specific requirements have to be evaluated by additional, user-provided logic. These corresponding faults of these two requirements are:

- **Pingback\_Server::RESPONSE\_FAULT\_ALREADY\_REGISTERED** the pingback has already been registered
- **Pingback\_Server::RESPONSE\_FAULT\_ACCESS\_DENIED** access to the server resource has been denied

After execution of the bound request, the implementor may leverage `Pingback_Server->setFault()` to ensure a proper response if all requirements of the request have not been met.

### Pingback\_Server-&gt;\_\_construct()

[](#pingback_server-__construct)

- `@param array $options` Array of options

Takes an array of options that will be automatically set. Creates the server instance and enabled the pingback method on it.

### Pingback\_Server-&gt;getOption()

[](#pingback_server-getoption)

- `@param string $option` Option to return
- `@return mixed` The value or null if not exist

Returns an option.

### Pingback\_Server-&gt;setOption()

[](#pingback_server-setoption)

- `@param string $option` Name of option
- `@param mixed $value` Value to set

Takes an array of options.

### Pingback\_Server-&gt;setOptions()

[](#pingback_server-setoptions)

- `@param array $options` Array of options

Takes an array of options.

### Pingback\_Server-&gt;execute()

[](#pingback_server-execute)

- `@param string $request` Evaluate this request

Evaluates the given request. If no argument is given, evaluates the set request.

### Pingback\_Server-&gt;setResponse()

[](#pingback_server-setresponse)

- `@param string $response` The response

Sets the response as a string.

### Pingback\_Server-&gt;setRequest()

[](#pingback_server-setrequest)

- `@param string $request` The request

Sets the request as a string.

### Pingback\_Server-&gt;getRequest()

[](#pingback_server-getrequest)

- `@return string` The request

Returns the request.

### Pingback\_Server-&gt;getResponse()

[](#pingback_server-getresponse)

- `@return string` The response

Returns the response.

### Pingback\_Server-&gt;getSourceURL()

[](#pingback_server-getsourceurl)

- `@return string` The source URL

Returns the source URL from the request.

### Pingback\_Server-&gt;getTargetURL()

[](#pingback_server-gettargeturl)

- `@return string` The target URL

Returns the target URL from the request.

### Pingback\_Server-&gt;getTargetURL()

[](#pingback_server-gettargeturl-1)

- `@return boolean` The target URL

Returns the target URL from the request.

### Pingback\_Server-&gt;getFaultAsArray()

[](#pingback_server-getfaultasarray)

- `@param integer $faultCode` The fault code
- `@return array` The fault (code and string) formatted as an array

Returns the passed fault code as an array fit for the response.

### Pingback\_Server-&gt;setFault()

[](#pingback_server-setfault)

- `@param integer $faultCode` The fault code to set

Sets the fault code of the request.

### Pingback\_Server-&gt;getSuccessAsArray()

[](#pingback_server-getsuccessasarray)

- `@return array` The success array

Returns the success response as an array fit for the response.

### Pingback\_Server-&gt;setSuccess()

[](#pingback_server-setsuccess)

Marks the current request as successful.

### Pingback\_Server-&gt;isValid()

[](#pingback_server-isvalid)

- `@return boolean` The request validity

Returns wheter or not the current request is considered valid.

#### Available options

[](#available-options)

The methods for setting options supports the following option names and values:

- `string 'encoding'` encoding used by the server

Responses
---------

[](#responses)

Pingback\_Server has a set of class constants that may be used with the appropriate methods on a server instance. The actual messages returned by the server can be manipulated by changing the strings in the `Pingback_Server->responses` array (where the array keys correspond to the class constants).

- **Pingback\_Server::RESPONSE\_FAULT\_GENERIC** Unknown error
- **Pingback\_Server::RESPONSE\_FAULT\_SOURCE** Source link invalid
- **Pingback\_Server::RESPONSE\_FAULT\_SOURCE\_LINK** Source is not backlinking to target
- **Pingback\_Server::RESPONSE\_FAULT\_TARGET** Target link invalid
- **Pingback\_Server::RESPONSE\_FAULT\_TARGET\_INVALID** Target is not pingback enabled
- **Pingback\_Server::RESPONSE\_FAULT\_ALREADY\_REGISTERED** Pingback already registered
- **Pingback\_Server::RESPONSE\_FAULT\_ACCESS\_DENIED** Access denied
- **Pingback\_Server::RESPONSE\_SUCCESS** Indicates success

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 81% 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 ~54 days

Total

3

Last Release

5053d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/41344?v=4)[Tedde Lundgren](/maintainers/tedeh)[@tedeh](https://github.com/tedeh)

---

Top Contributors

[![tedeh](https://avatars.githubusercontent.com/u/41344?v=4)](https://github.com/tedeh "tedeh (17 commits)")[![marcusjfloyd](https://avatars.githubusercontent.com/u/7179657?v=4)](https://github.com/marcusjfloyd "marcusjfloyd (2 commits)")[![barnabywalters](https://avatars.githubusercontent.com/u/968350?v=4)](https://github.com/barnabywalters "barnabywalters (1 commits)")[![callumacrae](https://avatars.githubusercontent.com/u/472830?v=4)](https://github.com/callumacrae "callumacrae (1 commits)")

---

Tags

pingback

### Embed Badge

![Health badge](/badges/tedeh-pingback/health.svg)

```
[![Health](https://phpackages.com/badges/tedeh-pingback/health.svg)](https://phpackages.com/packages/tedeh-pingback)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M81](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M89](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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