PHPackages                             hakone/middleware-dispatcher - 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. [Framework](/categories/framework)
4. /
5. hakone/middleware-dispatcher

ActiveLibrary[Framework](/categories/framework)

hakone/middleware-dispatcher
============================

A lightweight PSR-15 middleware dispatcher

0.1.0(3y ago)13.3k↓43.8%Apache-2.0PHPPHP &gt;=7.3

Since Mar 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hakonephp/middleware-dispatcher)[ Packagist](https://packagist.org/packages/hakone/middleware-dispatcher)[ RSS](/packages/hakone-middleware-dispatcher/feed)WikiDiscussions master Synced 1mo ago

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

Hakone PSR-15 middleware dispatcher 🏃‍♀️
========================================

[](#hakone-psr-15-middleware-dispatcher-‍️)

**Hakone** is a lightweight [PSR-15](https://www.php-fig.org/psr/psr-15/) middleware dispatcher implementation. It is inspired by [Relay](https://relayphp.com/).

Concept
-------

[](#concept)

The PSR-15 is designed to be general purpose middleware. All middleware can intervene in both requests and responses.

Hakone is a "queue-based request handler" described in [PSR-15 Meta Document](https://www.php-fig.org/psr/psr-15/meta/). The downside of queue-based is that the more middleware you have, the more stack traces will pile up.

We've written a number of small-duty middlewares, but for many use cases they only do work on either the request or the response. We decided to classify the types of middleware into three types: **"request interceptor"**, **"general-purpose middleware"** and **"response decorator"**.

How to use
----------

[](#how-to-use)

```
$dispatcher = Hakone\relay([
    'interceptors' => [
        // ...
    ],
    'middlewares' => [
        // ...
    ],
    'handler' => $handler
    'decorators' => [
        // ...
    ],
]);
```

Copyright
---------

[](#copyright)

```
Copyright 2023 USAMI Kenta

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

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

Total

2

Last Release

1166d ago

### Community

Maintainers

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

---

Top Contributors

[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (11 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hakone-middleware-dispatcher/health.svg)

```
[![Health](https://phpackages.com/badges/hakone-middleware-dispatcher/health.svg)](https://phpackages.com/packages/hakone-middleware-dispatcher)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k49.9M1.3k](/packages/slim-slim)[spiral/framework

Spiral, High-Performance PHP/Go Framework

2.0k1.8M57](/packages/spiral-framework)[cakephp/authentication

Authentication plugin for CakePHP

1153.6M67](/packages/cakephp-authentication)[slim/csrf

Slim Framework 4 CSRF protection PSR-15 middleware

3512.1M94](/packages/slim-csrf)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)

PHPackages © 2026

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