PHPackages                             millennium/router - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. millennium/router

ActiveLibrary[HTTP &amp; Networking](/categories/http)

millennium/router
=================

Millennium PHP Router

v2.0.1(10y ago)013MITPHP

Since May 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/development-x/PHPRouter)[ Packagist](https://packagist.org/packages/millennium/router)[ RSS](/packages/millennium-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

Router
======

[](#router)

**PHP Router** is totally inspired by [Gatakka/PGF-Router](https://github.com/gatakka/PGF-Router/) and does not use regular expressions too.

SensioLabs InsightTravis CIScrutinizer CI[![SensioLabsInsight](https://camo.githubusercontent.com/1420bfb683b4b38c01d163d34e8c1cbf28d8fa840b4b9880be68743391d1103e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33343535646238322d656264302d343736372d383532622d3135653936623361636137342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/3455db82-ebd0-4767-852b-15e96b3aca74)[![Build Status](https://camo.githubusercontent.com/e47f10fef19186f9791701f0eeb5f87efe3c4adb24081fa61f1579d30e064187/68747470733a2f2f7472617669732d63692e6f72672f6465736572746b6e696768742f504850526f757465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/desertknight/PHPRouter)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c7df6341bbf8314bc74c41806501b596b612c536ad49f2fc7160fb41672085da/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465736572746b6e696768742f504850526f757465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/desertknight/PHPRouter/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/f060c56b2cb51f8ff1bfec4b22f16416b2828cd8c49c203803858f85a999d139/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465736572746b6e696768742f504850526f757465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/desertknight/PHPRouter/?branch=master) [![Build Status](https://camo.githubusercontent.com/9bae1e00a8288b1e4f849f95c2480a0cf1d803e08c758e800fbef7370c752b18/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465736572746b6e696768742f504850526f757465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/desertknight/PHPRouter/build-status/master)[![Dependency Status](https://camo.githubusercontent.com/c114ecdded29280afe36aa08c3b91e96f9ae4b43598ace35eb9ce2b28ed2ba68/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535363266366533333636343636303031666233303030302f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/5562f6e3366466001fb30000) [![Latest Stable Version](https://camo.githubusercontent.com/0e75fccf2c10f80c3a1802647a97ac91f72a4878e43731d876f57ca22f2201be/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c656e6e69756d2f726f757465722f762f737461626c65)](https://packagist.org/packages/millennium/router) [![Total Downloads](https://camo.githubusercontent.com/0aeaab9d953f18ce31ec4a340c1b9c5acff49cbd68233b7f24ba2a5a2c3f5b4d/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c656e6e69756d2f726f757465722f646f776e6c6f616473)](https://packagist.org/packages/millennium/router) [![Latest Unstable Version](https://camo.githubusercontent.com/b6a1283e1b32db6eec2a119c8b5754c5360f5609a9c990a6b1309290b7d87e0b/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c656e6e69756d2f726f757465722f762f756e737461626c65)](https://packagist.org/packages/millennium/router) [![License](https://camo.githubusercontent.com/75cea990a4b253a59410acb924a64ad887fe96885bdbdbefee73cebed376b95d/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c656e6e69756d2f726f757465722f6c6963656e7365)](https://packagist.org/packages/millennium/router)

Requirements:
-------------

[](#requirements)

- "symfony/yaml": "\*"

Suggest
-------

[](#suggest)

- "php": "&gt;=5.4.0"
- "ext-mbstring": "\*"

Features:
---------

[](#features)

- *Integrate Memcache or other cache systems*
- *Maybe some refactoring and optimizing*

Installation and configuration:
-------------------------------

[](#installation-and-configuration)

Install with [Composer](http://packagist.org), run:

```
composer require millennium/phpcache
```

### Routers example

[](#routers-example)

This is sample router configuration

```
path: /                         # require
action:                         # Some action, we use Namespace:Controller:action
methods: []                     # any valid HTTP methods combination (GET, POST, PUT, DELETE) **ONLY UPPER STRING**
requires: []                    # requires url parameters
defaults: []                    # defaults parameters
security: []                    # this is future, for now is only validation ip request (eg. allow only from ips array)
import: path                    # you can import other yaml routing files, path, security and methods will be overriding
```

File look like this

```
homepage:
    path: /
    action: Namespace:Controller:action
user_action:
    path: /user/:id/:action
    action: Namespace:Controller:action
    methods:
        - GET
    requires:
        id: digit
        action: [add, view, edit, delete]
admin_user:
    path: /admin
    import: ./config/routes_user_admin.yml
    security:
        - { ip: [127.0.0.1, ::1] }
```

Usage examples:
---------------

[](#usage-examples)

```

```

#### Nginx

[](#nginx)

Under the `server` block of your virtual host configuration, you only need to add three lines.

```
location / {
  try_files $uri $uri/ /index.php?$args;
}

```

Contributions
-------------

[](#contributions)

Contributions to PHPRouter are welcome via pull requests.

License
-------

[](#license)

PHPRouter was created by [Zlatko Hristov](http://z-latko.info) and released under the MIT License.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~69 days

Total

5

Last Release

3739d ago

Major Versions

v1.0.4 → v2.0.12016-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/41c191e502b100dd8c784f467f7000cd12e0140ffe976c4d386b413a43d4fc57?d=identicon)[zlatin.hristov](/maintainers/zlatin.hristov)

---

Top Contributors

[![naskoff](https://avatars.githubusercontent.com/u/5497493?v=4)](https://github.com/naskoff "naskoff (18 commits)")[![DesertKnight](https://avatars.githubusercontent.com/u/3224264?v=4)](https://github.com/DesertKnight "DesertKnight (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

phprouterrouting systemarray tree

### Embed Badge

![Health badge](/badges/millennium-router/health.svg)

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

###  Alternatives

[aphiria/aphiria

The Aphiria framework

1427.7k2](/packages/aphiria-aphiria)[wilaak/radix-router

High-performance radix tree based HTTP request router

612.8k5](/packages/wilaak-radix-router)[eftec/routeone

Router service class for PHP

291.4k2](/packages/eftec-routeone)[divineniiquaye/flight-routing

Flight routing is a simple, fast PHP router that is easy to get integrated with other routers.

152.5k](/packages/divineniiquaye-flight-routing)

PHPackages © 2026

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