PHPackages                             bit55/litero - 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. bit55/litero

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

bit55/litero
============

Extra light router and dispatcher for small web applications.

0.9.0(8y ago)178214BSD-3-ClausePHPPHP ^7.0 || ^5.6

Since Aug 3Pushed 8y ago4 watchersCompare

[ Source](https://github.com/devgkz/litero)[ Packagist](https://packagist.org/packages/bit55/litero)[ Docs](https://github.com/bit55/litero)[ RSS](/packages/bit55-litero/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Litero
======

[](#litero)

**Extra light router and dispatcher for small web applications. Small footprint and no overhead.**

Router class in this package maps HTTP-requests by URL pattern to callbacks.

**Note:** It's component not support PSR-7 HTTP Message Interface out of the box.

Installing
----------

[](#installing)

Create project based on Litero in current directory:

```
composer create-project bit55/litero .

```

And add your application code to autoloading section in `composer.json`.

Or include Litero in your existing project:

```
composer require bit55/litero

```

Or download this repository and include file `Router.php` in your project.

Your webserver must point to the index.php file for any URI entered. See `.htaccess` for Apache and `example.nginx.conf` for Nginx configuration example.

Usage
-----

[](#usage)

Create Instance of Router class.

```
$router = Bit55\Litero\Router::fromGlobals();
```

Add routing rules. Routes may contents exact or wildcard rules.

Wildcards example:

- `/page/:seg` - any characters in one segment like `/page/qwerty` or `/page/123`;
- `/page/:num` - digits only like `/page/123`;
- `/page/:any` - any characters like `/page/qwerty` or `/page/qwerty/123`;

Route handler may be any callable (function name, closure) or string with controller class name and action method. Router instantiate controller and execute action method automatically.

Wildcard parameters will be passed as function params in handler.

Note if you using Composer, add your controller classes to autoloading.

Add single rule with Closure handler:

```
$router->add('/', function () {
    echo 'Hello from Litero!';
});
```

Or add array of routes.

```
$router->add([
    '/first'       => 'Bit55\Litero\ExampleController@firstAction',
    '/second/:any'  => 'Bit55\Litero\ExampleController@secondAction',
]);
```

Start route processing.

```
if ($router->isFound()) {
    $router->executeHandler(
        $router->getRequestHandler(),
        $router->getParams()
    );
}
else {
    // Simple "Not found" handler
    $router->executeHandler(function () {
        http_response_code(404);
        echo '404 Not found';
    });
}
```

Usage example code see in `index.php` file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

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

3207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3edf7428969cd30708fc9e929c22001d1bacacfb9507b8018b7b363d3b0cb13e?d=identicon)[devgkz](/maintainers/devgkz)

---

Top Contributors

[![devgkz](https://avatars.githubusercontent.com/u/4713006?v=4)](https://github.com/devgkz "devgkz (10 commits)")

### Embed Badge

![Health badge](/badges/bit55-litero/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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