PHPackages                             curesaba/php-subscriber - 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. curesaba/php-subscriber

ActiveLibrary

curesaba/php-subscriber
=======================

A PHP client library implementing a PubSubHubbub (WebSub) subscriber with hub.secret support.

1.4.0(11mo ago)16Apache-2.0PHPPHP ~5.4 || ~7.0 || ~8.0

Since Jun 5Pushed 11mo agoCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP PubSubHubbub (WebSub) Subscriber
====================================

[](#php-pubsubhubbub-websub-subscriber)

This PHP library implements a subscriber for PubSubHubbub (WebSub) with support for the `hub.secret` parameter for secure HMAC signature verification and flexible configuration options including `verify_token`.

Originally written by [Josh Fraser](http://joshfraser.com) and currently maintained by [CureSaba](https://github.com/CureSaba).
Released under the Apache 2.0 License.

**Official package:** [pubsubhubbub/subscriber](https://github.com/pubsubhubbub/php-subscriber)
**Maintained fork:** [curesaba/php-subscriber](https://github.com/CureSaba/php-subscriber)

---

Install
-------

[](#install)

Update your `composer` require block:

```
"require": { "curesaba/php-subscriber": "*" }
```

Or install via Composer:

```
composer require curesaba/php-subscriber
```

---

Usage
-----

[](#usage)

```
use \Pubsubhubbub\Subscriber\Subscriber;

$hub_url      = "http://pubsubhubbub.appspot.com";
$callback_url = "https://yourdomain.example/endpoint";
$secret       = "your-very-random-string"; // Used for HMAC verification
$verify_token = "your-verify-token"; // Used to validate intent verification requests

// create a new subscriber with flexible options (all parameters optional except hub_url and callback_url)
$s = new Subscriber(
    $hub_url,
    $callback_url,
    false,           // credentials (optional)
    $secret,         // hub.secret (optional)
    'async',         // verify mode (optional, default 'async')
    $verify_token,   // verify_token (optional)
    3600             // lease_seconds (optional)
);

$feed = "http://feeds.feedburner.com/onlineaspect";

// subscribe to a feed
$s->subscribe($feed);

// unsubscribe from a feed
$s->unsubscribe($feed);

// You can also set properties after construction:
$s->setVerifyToken('another-token')->setLeaseSeconds(7200);
```

### Parameters

[](#parameters)

- **$hub\_url**: The PubSubHubbub (WebSub) hub endpoint. (Required)
- **$callback\_url**: Your endpoint to receive notifications. (Required)
- **$credentials**: (Optional) HTTP Basic Auth credentials for the hub.
- **$secret**: (Optional but recommended) Secret string for verifying HMAC signatures (`hub.secret`).
- **$verify**: (Optional) Verification mode `"async"` or `"sync"`. Default: `"async"`.
- **$verify\_token**: (Optional) Token for intent verification.
- **$lease\_seconds**: (Optional) Subscription lease duration in seconds.

#### Property Setters

[](#property-setters)

All parameters (except `$google_key`) can also be set or changed after instantiation using the following setter methods:

- `setHubUrl($hub_url)`
- `setCallbackUrl($callback_url)`
- `setCredentials($credentials)`
- `setSecret($secret)`
- `setVerify($verify)`
- `setVerifyToken($verify_token)`
- `setLeaseSeconds($lease_seconds)`

---

HMAC Signature Verification
---------------------------

[](#hmac-signature-verification)

When using `hub.secret`, notifications sent from the hub will include an `X-Hub-Signature` header.
You should verify this in your callback endpoint:

```
$body = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_HUB_SIGNATURE'] ?? '';
$expected = 'sha1=' . hash_hmac('sha1', $body, $secret);

if (hash_equals($expected, $signature)) {
    // Signature valid
} else {
    // Signature invalid
}
```

---

License
-------

[](#license)

Apache License 2.0

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance51

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~2 days

Total

2

Last Release

345d ago

### Community

Maintainers

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

---

Top Contributors

[![texdc](https://avatars.githubusercontent.com/u/1590605?v=4)](https://github.com/texdc "texdc (7 commits)")[![pfefferle](https://avatars.githubusercontent.com/u/2373?v=4)](https://github.com/pfefferle "pfefferle (6 commits)")[![CureSaba](https://avatars.githubusercontent.com/u/94890302?v=4)](https://github.com/CureSaba "CureSaba (6 commits)")[![themel](https://avatars.githubusercontent.com/u/160316?v=4)](https://github.com/themel "themel (4 commits)")[![maksverver](https://avatars.githubusercontent.com/u/595620?v=4)](https://github.com/maksverver "maksverver (3 commits)")[![rmruano](https://avatars.githubusercontent.com/u/1115642?v=4)](https://github.com/rmruano "rmruano (2 commits)")[![CupOfTea696](https://avatars.githubusercontent.com/u/7327050?v=4)](https://github.com/CupOfTea696 "CupOfTea696 (1 commits)")[![MR4online](https://avatars.githubusercontent.com/u/17498992?v=4)](https://github.com/MR4online "MR4online (1 commits)")[![karptonite](https://avatars.githubusercontent.com/u/132278?v=4)](https://github.com/karptonite "karptonite (1 commits)")[![harikt](https://avatars.githubusercontent.com/u/120454?v=4)](https://github.com/harikt "harikt (1 commits)")[![danmichaelo](https://avatars.githubusercontent.com/u/434495?v=4)](https://github.com/danmichaelo "danmichaelo (1 commits)")

---

Tags

datasubscriberfeedspubsubhubbubwebsub

### Embed Badge

![Health badge](/badges/curesaba-php-subscriber/health.svg)

```
[![Health](https://phpackages.com/badges/curesaba-php-subscriber/health.svg)](https://phpackages.com/packages/curesaba-php-subscriber)
```

###  Alternatives

[fakerphp/faker

Faker is a PHP library that generates fake data for you.

4.0k358.5M3.5k](/packages/fakerphp-faker)[nelmio/alice

Expressive fixtures generator

2.5k43.4M133](/packages/nelmio-alice)[dflydev/dot-access-data

Given a deep data structure, access data by dot notation.

720359.1M86](/packages/dflydev-dot-access-data)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k23.3M302](/packages/doctrine-mongodb-odm)[theofidry/alice-data-fixtures

Nelmio alice extension to persist the loaded fixtures.

32328.5M70](/packages/theofidry-alice-data-fixtures)[pubsubhubbub/subscriber

pubsubhubbub implementation of subscriber.

32100.2k](/packages/pubsubhubbub-subscriber)

PHPackages © 2026

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