PHPackages                             alvinios/miel - 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. alvinios/miel

ActiveLibrary

alvinios/miel
=============

Object-oriented Web Micro Framework

1.0.0(1y ago)02MITPHPPHP &gt;=8.1.0

Since Jan 19Pushed 9mo ago1 watchersCompare

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

READMEChangelogDependencies (12)Versions (3)Used By (0)

About The Project
-----------------

[](#about-the-project)

**Miel** is an object-oriented PHP web development micro-framework (MIEL stands for Micro + Elegant, it also means "honey" in French). It' intend is to be designed based on *elegant objects* principles of [Yegor Bugayenko](https://yegor256.com). It means :

- No mutable classes
- No `null`s
- No type-checking or reflexion
- No `public` `static` methods or `constants`
- No configuration files
- No DI container

It was inspired by the framework [Takes](https://github.com/yegor256/takes)For being operational it requires [PSR-7](https://www.php-fig.org/psr/psr-7/) and [PSR-17](https://www.php-fig.org/psr/psr-17/) implementations/libraries of your choice. For example [Guzzle PSR-7](https://github.com/guzzle/psr7)

Getting Started
---------------

[](#getting-started)

```
composer require alvinios/miel

```

Quick Start
-----------

[](#quick-start)

Create this `index.php` file:

```
use Alvinios\Miel\App;
use Alvinios\Miel\Http\Emit;
use Alvinios\Miel\Response\Text;
use Alvinios\Miel\Fork\Regex;
use GuzzleHttp\Psr7\{HttpFactory, ServerRequest};

(new Emit())(
    (new App(
        new Regex('/', new Text('Hello world!'))
    ))->response(ServerRequest::fromGlobals(), new HttpFactory(), new HttpFactory())
);
```

Cd to your index.php folder and run php local server

```
php -S localhost:8000

```

A Bigger Example
----------------

[](#a-bigger-example)

```
use Alvinios\Miel\App;
use Alvinios\Miel\Http\Emit;
use Alvinios\Miel\Endpoint\Base;
use Alvinios\Miel\Request\WithRegex;
use Alvinios\Miel\Response\{Json, Response, Text, Twig};
use Alvinios\Miel\Fork\{Regex, Methods};
use GuzzleHttp\Psr7\{HttpFactory, ServerRequest};
use Psr\Http\Message\ServerRequestInterface;

(new Emit())(
  (new App(
        new Regex('/', new Text('Hello world!')),
        new Regex(
            '/users/(?P[\d]+)',
            new Methods(
                ['post'],
                new class() extends Base {
                    public function act(ServerRequestInterface $request): Response {
                        return new Json(
                            json_decode($request->getBody()->getContents())
                        );
                    }
                }
            ),
            new Methods(
                ['get'],
                new class() extends Base {
                    public function act(ServerRequestInterface|WithRegex $request): Response {
                        return new Text(sprintf(
                            'User %s',
                            $request->regex()->group('id')
                        ));
                    }
                }
            )
        )
  ))->response(ServerRequest::fromGlobals(), new HttpFactory(), new HttpFactory())
);
```

Generators
----------

[](#generators)

Routes can be composed as variadic argument of *Routes* or with [Generators](https://www.php.net/manual/en/language.generators.overview.php) using *Append* wrapper.

```
use Alvinios\Miel\App;
use Alvinios\Miel\Response\{Text, Twig};
use Alvinios\Miel\Fork\{Append, Regex};

 new App(
     new Append(
         call_user_func(function() : \Iterator {
             yield new Regex('^(/|/home)$', new Twig($this->twig, 'index.html.twig', []));
         }),
         call_user_func(function() : \Iterator {
             yield new Regex('/foo', new Text('Foo'));
             yield new Regex('/bar', new Text('Bar'));
         })
     )
)
```

Middleware Support
------------------

[](#middleware-support)

You can shield a route/routes behind [PSR-15](https://www.php-fig.org/psr/psr-15/) Middleware(s). This is how it can be done:

### Multiple Middlewares

[](#multiple-middlewares)

```
use Alvinios\Miel\Fork\{Regex, Shields};
use Psr\Http\Server\MiddlewareInterface;

new Shields(
    new Regex('/foo', new Text('Behind middleware')),
    new class() implements MiddlewareInterface {
       ...
    },
    new class() implements MiddlewareInterface {
       ...
    }
)
```

*Shields* can be nested.

### Single Middleware

[](#single-middleware)

```
use Alvinios\Miel\Fork\Shield;
use Psr\Http\Server\MiddlewareInterface;

new Shield(
    new class() implements MiddlewareInterface {
        ...
    },
    new Regex('/foo', new Text('Behind middleware'))
)
```

Note
----

[](#note)

Today the project is in a conceptual state and has not been tested in production environment.

License
-------

[](#license)

Distributed under the MIT License. See `LICENSE.txt` for more information.

([back to top](#readme-top))

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance49

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

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

477d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4286ed7900498db00c7051585cadd6c051ae2761e4afa7a8a7b9938fce55e094?d=identicon)[Alvinios](/maintainers/Alvinios)

---

Top Contributors

[![alvinios](https://avatars.githubusercontent.com/u/143874476?v=4)](https://github.com/alvinios "alvinios (12 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/alvinios-miel/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)

PHPackages © 2026

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