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

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

pig/router
==========

1.0.17(4mo ago)08PHP

Since Dec 28Pushed 4mo agoCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

### install

[](#install)

```
composer require pig/router

```

example 0:

```
$router = new \Pig\Router\Router();
try {
    $router->loadRoutes(__DIR__ . "/api.php");
    $router->dispatch();
} catch (\Pig\Router\NotFoundException $e) {
    # 404
} catch (\Pig\Router\InvalidCallbackException $e) {
    echo $e->getMessage();
}
```

api.php:

```
/**
 * @var \Pig\Router\Router $router
 */
$router->get('/test/test1', [\pilots\TestController::class, 'test01']);
$router->group('/test', [], function (\Pig\Router\Router $router) {
    $router->post('/create', [\pilots\UserController::class, 'create01']);
    // 带参数的路由
    $router->get('/info/(\w+)', [\pilots\UserController::class, 'info01']);
    $router->get('/info/{name}', [\pilots\UserController::class, 'info01']);
});
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance76

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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

Total

3

Last Release

131d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fd6cb8950d77fdebcef7c1cd1eac849e5610deddf19aa539f76b371ccaee152?d=identicon)[sn01615](/maintainers/sn01615)

---

Top Contributors

[![sn01615](https://avatars.githubusercontent.com/u/7794149?v=4)](https://github.com/sn01615 "sn01615 (18 commits)")

### Embed Badge

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

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

PHPackages © 2026

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