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 2w 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 52% 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

3254d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4713006?v=4)[Evgeniy D.](/maintainers/devgkz)[@devgkz](https://github.com/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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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