PHPackages                             org\_heigl/clacks-middleware - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. org\_heigl/clacks-middleware

ActiveMiddleware[Utility &amp; Helpers](/categories/utility)

org\_heigl/clacks-middleware
============================

Implements the Clacks-Header as per http://www.gnuterrypratchett.com

1.2.0(7y ago)61.2k[2 PRs](https://github.com/heiglandreas/X-Clacks-Overhead/pulls)MITPHPPHP ^7.1

Since Apr 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/heiglandreas/X-Clacks-Overhead)[ Packagist](https://packagist.org/packages/org_heigl/clacks-middleware)[ RSS](/packages/org-heigl-clacks-middleware/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (9)Used By (0)

X-Clacks-Overhead
=================

[](#x-clacks-overhead)

[![Build Status](https://camo.githubusercontent.com/f70476e433976fee651b8684f0d7ad99268f76f9782bda860158be0bc372543f/68747470733a2f2f7472617669732d63692e6f72672f686569676c616e64726561732f582d436c61636b732d4f766572686561642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/heiglandreas/X-Clacks-Overhead)

As described in

Installation
------------

[](#installation)

```
composer require org_heigl/clacks-middleware
```

Usage
-----

[](#usage)

### PSR-7

[](#psr-7)

```
use Org_Heigl\Middleware\Clacks\Clacks;

$clacks = new Clacks();
// add $clacks to your middleware-stack
```

When someone sends a request that already contains an `X-Clacks-Overhead` header, that header is returned.

And when you want to send a different name, you can set that on the constructor like this:

```
use Org_Heigl\Middleware\Clacks\Clacks;

$clacks = new Clacks('Jane Doe');
// add $clacks to your middleware-stack
```

### PSR-15

[](#psr-15)

If you are using a PSR15 based stack you can use the `ClacksMiddleware`-Class instead like this:

```
use Org_Heigl\Middleware\Clacks\ClacksMiddleware;

$clacks = new ClacksMiddleware();
// Add $clacks to your middleware-stack
```

### Adding $clacks to the middleware

[](#adding-clacks-to-the-middleware)

#### Slim 4

[](#slim-4)

```
use Slim\Factory\AppFactory;
use Org_Heigl\Middleware\Clacks\ClacksMiddleware;

$app = AppFactory::create();
$app->add(new ClacksMiddleware());
$app->run();
```

#### Slim 3

[](#slim-3)

```
use \Slim\App;
use Org_Heigl\Middleware\Clacks\Clacks;

$app = new App();

$app->add(new Clacks());

$app->get('/', function ($request, $response, $args) {
	$response->getBody()->write(' Hello ');

	return $response;
});

$app->run();
```

#### Mezzio

[](#mezzio)

```
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use Laminas\HttpHandlerRunner\RequestHandlerRunner;
use Laminas\Stratigility\MiddlewarePipe;
use Org_Heigl\Middleware\Clacks\ClacksMiddleware;
use function Laminas\Stratigility\middleware;

$app = new MiddlewarePipe();

// Landing page
$app->pipe(middleware(new ClacksMiddleware()));

$server = new RequestHandlerRunner(
    $app,
    new SapiEmitter(),
    static function () {
        return ServerRequestFactory::fromGlobals();
    },
    static function (\Throwable $e) {
        $response = (new ResponseFactory())->createResponse(500);
        $response->getBody()->write(sprintf(
            'An error occurred: %s',
            $e->getMessage
        ));
        return $response;
    }
);

$server->run();
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~287 days

Total

4

Last Release

2873d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ae5183aaad2bc7453230704bd6991dc6ccbcd6e775c6a29efdc94350a69f247?d=identicon)[heiglandreas](/maintainers/heiglandreas)

---

Top Contributors

[![heiglandreas](https://avatars.githubusercontent.com/u/91998?v=4)](https://github.com/heiglandreas "heiglandreas (12 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

clacksPratchettdiscworldclacker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/org-heigl-clacks-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/org-heigl-clacks-middleware/health.svg)](https://phpackages.com/packages/org-heigl-clacks-middleware)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73147.2k29](/packages/jaxon-php-jaxon-core)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)[fisharebest/webtrees

webtrees online genealogy

77416.0k20](/packages/fisharebest-webtrees)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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