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. org\_heigl/clacks-middleware

ActiveMiddleware

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

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

1.2.0(7y ago)61.2k↓100%[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 1mo 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 77% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity20

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

2828d 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.8k18.5M1.6k](/packages/cakephp-cakephp)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[windwalker/framework

The next generation PHP framework.

25639.1k1](/packages/windwalker-framework)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[openswoole/core

Openswoole core library

181.1M32](/packages/openswoole-core)

PHPackages © 2026

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