PHPackages                             vladzimir/f3-relay - 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. vladzimir/f3-relay

ActiveLibrary[Framework](/categories/framework)

vladzimir/f3-relay
==================

Simple middleware dispatcher for Fat-Free Framework

v1.0.0(3w ago)02GPL-3.0PHPPHP ~8.3.0

Since May 16Pushed 3w agoCompare

[ Source](https://github.com/Vladzimir/f3-relay)[ Packagist](https://packagist.org/packages/vladzimir/f3-relay)[ Docs](https://github.com/vladzimir/f3-relay)[ RSS](/packages/vladzimir-f3-relay/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

f3-relay
========

[](#f3-relay)

Simple middleware relay and controller proxy hooks for Fat-Free Framework (F3).

- works with PHP 8.3+
- tested target: F3 3.9

### Installation

[](#installation)

- Method 1: `composer require vladzimir/f3-relay`
- Method 2: copy `lib/*` into your project `lib/` (or any F3 autoloaded path)

### Quick start

[](#quick-start)

```
use F3Relay\Relay;

$relay = Relay::instance();

// Register middleware for key "web"
$relay->pipe('web', [
    static function () {
        // return false to stop chain
        return true;
    }
]);

// Run chain
$relay->run('web');
```

### Conditional middleware (matchers)

[](#conditional-middleware-matchers)

Each pipe item may contain matchers first and middleware last.

```
use F3Relay\Relay;
use F3Relay\Matchers\MatcherPath;
use F3Relay\Matchers\MatcherHive;

$relay = Relay::instance();

$relay->pipe('web', [
    new MatcherPath('/admin/*'),
    new MatcherHive('VERB', 'GET'),
    static function () {
        // runs only if all matchers are true
        return true;
    }
], priority: 20);
```

Available matchers:

- `MatcherPath(pattern, flags = 0)`
- `MatcherHive(key, pattern)`
- `MatcherPattern(pattern, flags = 0, source = 'PATH')`

Use `!` prefix in pattern for negative match, e.g. `!/api/*`.

### Controller hooks

[](#controller-hooks)

`ControllerProxy` lets you install global before/after hooks for controllers resolved via F3 `CONTAINER`.

```
use F3Relay\ControllerProxy;

ControllerProxy::install(
    before: static function (array $params, object $controller, ?array $args): bool {
        // return false to cancel route handling
        return true;
    },
    after: static function (array $params, object $controller, ?array $args): void {
        // post-processing
    }
);
```

Notes:

- `before` runs before controller `beforeroute()`
- `after` runs after controller `afterroute()`
- returning `false` from a hook stops further processing

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance95

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

24d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5346225?v=4)[Vladzimir](/maintainers/Vladzimir)[@Vladzimir](https://github.com/Vladzimir)

---

Top Contributors

[![Vladzimir](https://avatars.githubusercontent.com/u/5346225?v=4)](https://github.com/Vladzimir "Vladzimir (2 commits)")

---

Tags

dispatcherf3fat-free-frameworkfatfreefatfree-frameworkfatfreeframeworkmiddlewarephppipelinerelaymiddlewaredispatcherpipelineRelayF3fatfreetweaks

### Embed Badge

![Health badge](/badges/vladzimir-f3-relay/health.svg)

```
[![Health](https://phpackages.com/badges/vladzimir-f3-relay/health.svg)](https://phpackages.com/packages/vladzimir-f3-relay)
```

###  Alternatives

[mpociot/pipeline

Simple PHP middleware pipeline

1361.7M13](/packages/mpociot-pipeline)[contributte/middlewares

Middleware / Relay / PSR-7 support to Nette Framework

222.3M3](/packages/contributte-middlewares)[ikkez/f3-middleware

A middleware router plugin for PHP Fat-Free Framework

2517.0k1](/packages/ikkez-f3-middleware)[yiisoft/middleware-dispatcher

PSR-15 middleware dispatcher

17396.3k16](/packages/yiisoft-middleware-dispatcher)[ikkez/f3-assets

CSS/JS Assets Plugin for PHP Fat-Free Framework

3015.7k4](/packages/ikkez-f3-assets)

PHPackages © 2026

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