PHPackages                             guglielmopepe/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. guglielmopepe/dispatcher

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

guglielmopepe/dispatcher
========================

Dispatcher provides a flexible dispatch component.

1.0.0(3y ago)09MITPHPPHP ^7.2.0 || ^8.0.0

Since Mar 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/GuglielmoPepe/dispatcher)[ Packagist](https://packagist.org/packages/guglielmopepe/dispatcher)[ Docs](https://github.com/GuglielmoPepe/dispatcher)[ RSS](/packages/guglielmopepe-dispatcher/feed)WikiDiscussions main Synced 1mo ago

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

Dispatcher
==========

[](#dispatcher)

Dispatcher provides a flexible dispatch component.

Table of Contents
-----------------

[](#table-of-contents)

- [Benefits](#benefits)
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
- [Support](#support)
- [Faq](#faq)
- [Contributing](#contributing)
- [Contacts](#contacts)
- [Roadmap](#roadmap)
- [Change log](#change-log)
- [License](#license)

Benefits
--------

[](#benefits)

- Dispatcher use design pattern
- Dispatcher is flexible
- Dispatcher is simple

Features
--------

[](#features)

Dispatcher allows you to create rule-based or convention-based handlers.

Dispatcher allows you to create routes that map HTTP verbs.

Dispatcher use the Chain of Responsability pattern to pass parameters down the chain until it finds the right handler.

In case there is no handler that can handle the request an exception will be thrown.

Prerequisites
-------------

[](#prerequisites)

Requires PHP 7.2.0 or newer.

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

[](#installation)

Use Composer

```
$ composer require guglielmopepe/dispatcher
```

Usage
-----

[](#usage)

```
$dispatcher = new \Dispatcher\Classes\Handlers\Convention();
$dispatcher->connect(new \Dispatcher\Classes\Handlers\NotFound());

$params = [];

if (isset($_GET['route']))
{
    $params['route'] = $_GET['route'];
}

$route = $dispatcher->handle($params);

$method = strtolower($_SERVER['REQUEST_METHOD']);

$route->$method();

exit(0);
```

Documentation
-------------

[](#documentation)

Dispatcher include two default handler: Convention handler and NotFound handler.

The Convention handler match the value corrisponding route key in handler's parameters or Home route.

The NotFound handler match the parameters with NotFound route.

Support
-------

[](#support)

If you need information, please create a GitHub [issue](https://github.com/GuglielmoPepe/dispatcher/issues).

If you discover a security vulnerability, please send an email to Guglielmo Pepe at [info@guglielmopepe.com](mailto:%69%6e%66%6f%40%67%75%67%6c%69%65%6c%6d%6f%70%65%70%65%2e%63%6f%6d). All security vulnerabilities will be promptly addressed.

Faq
---

[](#faq)

To do.

Contributing
------------

[](#contributing)

If you want to say **thank you** and/or support the active development of `dispatcher`:

1. Add a [GitHub Star](https://github.com/GuglielmoPepe/dispatcher/stargazers) to the project.
2. Share the project on social media.
3. Write a review or tutorial on [Medium](https://medium.com/), [Dev.to](https://dev.to/) or personal blog.

Contacts
--------

[](#contacts)

If you need information, please create a GitHub [issue](https://github.com/GuglielmoPepe/dispatcher/issues) or send an email to [info@guglielmopepe.com](mailto:%69%6e%66%6f%40%67%75%67%6c%69%65%6c%6d%6f%70%65%70%65%2e%63%6f%6d).

Roadmap
-------

[](#roadmap)

See the list of [open issues](https://github.com/GuglielmoPepe/dispatcher/issues):

- [enhancement](https://github.com/GuglielmoPepe/dispatcher/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc)
- [bugs](https://github.com/GuglielmoPepe/dispatcher/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc)

Change log
----------

[](#change-log)

Please see [Changelog file](changelog.md) for more information on what has changed recently.

License
-------

[](#license)

Distributed under the MIT License. Please see [License File](license.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

1140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78403a0da6c632ef8031333aec102230dcd8ddabbc62576fd74c5e84c6122b1b?d=identicon)[Guglielmo Pepe](/maintainers/Guglielmo%20Pepe)

---

Top Contributors

[![GuglielmoPepe](https://avatars.githubusercontent.com/u/1424836?v=4)](https://github.com/GuglielmoPepe "GuglielmoPepe (28 commits)")

---

Tags

dispatchroutingroutingdispatcher

### Embed Badge

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

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

###  Alternatives

[lord/laroute

Access Laravels URL/Route helper functions, from JavaScript.

8022.0M8](/packages/lord-laroute)[bramus/router

A lightweight and simple object oriented PHP Router

1.1k458.8k49](/packages/bramus-router)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[contributte/event-dispatcher

Best event dispatcher / event manager / event emitter for Nette Framework

292.4M19](/packages/contributte-event-dispatcher)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

39488.5k](/packages/wazum-sluggi)[te7a-houdini/laroute

Access Laravels URL/Route helper functions, from JavaScript.

33512.1k](/packages/te7a-houdini-laroute)

PHPackages © 2026

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