PHPackages                             divineniiquaye/php-rade - 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. [Framework](/categories/framework)
4. /
5. divineniiquaye/php-rade

Abandoned → [biurad/flange](/?search=biurad%2Fflange)Library[Framework](/categories/framework)

divineniiquaye/php-rade
=======================

A fast micro, compilable, and scalable PHP framework

v1.1.3(7y ago)5222MITPHPPHP &gt;=5.6.0CI passing

Since Mar 23Pushed 2y ago2 watchersCompare

[ Source](https://github.com/biurad/flange)[ Packagist](https://packagist.org/packages/divineniiquaye/php-rade)[ Fund](https://biurad.com/sponsor)[ Patreon](https://www.patreon.com/biurad)[ RSS](/packages/divineniiquaye-php-rade/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

The PHP Flange Framework
========================

[](#the-php-flange-framework)

[![PHP Version](https://camo.githubusercontent.com/c089ee42c09ad9b952c18933688e4ca61c4f383dfea73ffca2addb5c743c54b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6269757261642f666c616e67652e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](http://php.net)[![Latest Version](https://camo.githubusercontent.com/467d3addab1486ad9a902144f6de556d7cd5471c6c766915b1249560ac91af00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6269757261642f666c616e67652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/biurad/flange)[![Workflow Status](https://camo.githubusercontent.com/f64de5eef35c9a0a1ca6b5076b9e35f9c8f69ced7ee304a2a7790489e93c7fec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6269757261642f666c616e67652f6275696c643f7374796c653d666c61742d737175617265)](https://github.com/biurad/flange/actions?query=workflow%3Abuild)[![Code Maintainability](https://camo.githubusercontent.com/85df45d596730335b4a635489854835d8f9dfbe61e5b90c1b98ed27748f044a7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f6269757261642f666c616e67653f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/biurad/flange)[![Coverage Status](https://camo.githubusercontent.com/69ce4767e1ce09d60a7ca561552301d956eeba4bf5dd42553087f170f210ae85/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6269757261642f666c616e67653f7374796c653d666c61742d737175617265)](https://codecov.io/gh/biurad/flange)[![Quality Score](https://camo.githubusercontent.com/cbc9360ab0d0a5a830b3ca291ff34acb8bf6d011745dd60fa86c6eca738d634f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6269757261642f666c616e67652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/biurad/flange)

---

**Flange** is an incredibly fast, compilable and scalable framework for [PHP](https://php.net) 8.0+ based on [PSR-7](http://www.php-fig.org/psr/psr-7/), [PSR-11](http://www.php-fig.org/psr/psr-11/), [PSR-14](http://www.php-fig.org/psr/psr-14/) and [PSR-15](http://www.php-fig.org/psr/psr-15/) with support for annotations/attributes, created by [Divine Niiquaye](https://github.com/divineniiquaye).

This library is shipped with lots of features that suites developers needs in developing web applications. Flange is truly scalable, has less dependencies and has high performance.

> Flange v2.0 is in early stage development and is not recommended for production use.

📦 Installation &amp; Basic Usage
--------------------------------

[](#-installation--basic-usage)

This project requires [PHP](https://php.net) 8.0 or higher. The recommended way to install, is via [Composer](https://getcomposer.org). Simply run:

```
$ composer require biurad/flange 2.0.*
```

Flange is built based on [Flight Routing](https://github.com/divineniiquaye/flight-routing), [Biurad DI](https://github.com/biurad/php-di), [Symfony components](https://github.com/symfony) and [Biurad libraries](https://github.com/biurad). Flange is a fully PSR complaint [PHP](https://php.net) framework, fully customizable and can even be used to develop from small to large projects:

```
require_once __DIR__ . '/vendor/autoload.php';

// Boot the application.
$app = new Flange\Application();

// Add a route to application
$app->match('/hello/{name:\w+}', to: fn (string $name): string => 'Hello ' . $app->escape()->escapeHtml($name));

$extensions = [
    [Flange\Extensions\CoreExtension::class, [__DIR__]],
    // You can add more extensions here ...
];

//If you want to use extensions, here is an example:
$app->loadExtensions($extensions, ['config' => '%project_dir%/config']);

// You can set custom pages for caught exceptions, using default event dispatcher, or your custom event dispatcher.
$app->getDispatcher()?->addListener(Flange\Events::EXCEPTION, new ErrorListener(), -8);

$app->run();
```

Working on a big project!, it is advisable to use the application's cacheable version. This gives you over 60% - 100% more performance than using the un-cacheable Application class with extensions.

```
use function Rade\DI\Loader\{param, phpCode, wrap};

$config = [
    'cacheDir' => __DIR__ . '/caches',
    'debug' => $_ENV['APP_DEBUG'] ?? false, // Set the debug mode environment
];

// Setup cache for application.
$app = Flange\AppBuilder::build(static function (Flange\AppBuilder $creator): void {
    // Add resource to re-compile if changes are made to this file.
    $creator->addResource(new FileResource(__FILE__));

    // Adding routes requires the Rade\DI\Extensions\RoutingExtension to be loaded.
    // Routes should always be added before Rade\DI\Extensions\RoutingExtension is booted, else it will not be compiled.
    $creator->match('/hello/{name:\w+}', to: phpCode('fn (string $name): string => \'Hello \' . $this->escape()->escapeHtml($name);'));

    $extensions = [
        [Flange\Extensions\CoreExtension::class, [__DIR__]],
        // You can add more extensions here ...
    ];

    //If you want to use extensions, here is an example as its recommended to use extensions to build your application.
    $creator->loadExtensions($extensions, ['config' => '%project_dir%/config']);

    // You can set custom pages for caught exceptions, using default event dispatcher, or your custom event dispatcher.
    $creator->definition('events.dispatcher')->bind('addListener', [Flange\Events::EXCEPTION, wrap(ErrorListener::class), -8]);
}, $config);

$app->run(); // Boot the application.
```

Here's an example of a custom error you can use for your application.

```
use Biurad\Http\Response\HtmlResponse;
use Flange\Event\ExceptionEvent;

class ErrorListener
{
    public function __invoke(ExceptionEvent $event): void
    {
        // If extensions were loaded, the %project_dir% will exist, else replace will absolute path
        $errorsPath = $event->getApplication()->parameter('%project_dir%/errors/');

        $code = $event->getThrowable()->getCode();
        $templates = [
            $errorsPath . \substr($code, 0, 2) . 'x.html.php', // 40x.html.php format ...
            $errorsPath . \substr($code, 0, 1) . 'xx.html.php', // 4xx.html.php format ...
            $errorsPath . $code . '.html.php', // 404.html.php format ...
            $errorsPath . 'default.html.php',
        ];

        // Tries to load a template file from a list of error templates.
        foreach ($template as $template) {
            if (\file_exists($template)) {
                $event->setResponse(
                    (static function () use ($template, $code) {
                        \ob_start();
                        include __DIR__ . $template;

                        return new HtmlResponse(\ob_get_clean(), (int) $code);
                    })()
                );
            }
        }
    }
}
```

Important to note that, using [PSR-15](http://www.php-fig.org/psr/psr-15/) middlewares stack uses the [PHP](https://php.net) SPL Queue class with the following algorithm, LAST &lt;- FIRST : FIRST -&gt; LAST. Loading extensions and events listeners by default uses the priority stacking algorithm (which means the higher the priority, the earlier an extension or event listener will be triggered in the chain) which defaults to 0.

📓 Documentation
---------------

[](#-documentation)

In-depth documentation on how to use this library, kindly check out the [documentation](https://divinenii.com/courses/flange/) for this library. It is also recommended to browse through unit tests in the [tests](./tests/) directory.

🙌 Sponsors
----------

[](#-sponsors)

If this library made it into your project, or you interested in supporting us, please consider [donating](https://biurad.com/sponser) to support future development.

👥 Credits &amp; Acknowledgements
--------------------------------

[](#-credits--acknowledgements)

- [Divine Niiquaye Ibok](https://github.com/divineniiquaye) is the author this library.
- [All Contributors](https://github.com/biurad/flange/contributors) who contributed to this project.

📄 License
---------

[](#-license)

Flange is completely free and released under the [BSD 3 License](LICENSE).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.4% 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 ~1 days

Total

5

Last Release

2597d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a71bed376af70d8c5eeb12c80cfb4bf428f70e48301fb2bba1d4a87009e20eeb?d=identicon)[divineniiquaye](/maintainers/divineniiquaye)

---

Top Contributors

[![divineniiquaye](https://avatars.githubusercontent.com/u/53147395?v=4)](https://github.com/divineniiquaye "divineniiquaye (309 commits)")[![cyclonecopp](https://avatars.githubusercontent.com/u/46801032?v=4)](https://github.com/cyclonecopp "cyclonecopp (15 commits)")

---

Tags

frameworkmicrophppsr-11psr-14psr-15psr-17psr-7radesymfonyframeworkhhvmphp 7php frameworkbiuradradionbiurad slim framework

### Embed Badge

![Health badge](/badges/divineniiquaye-php-rade/health.svg)

```
[![Health](https://phpackages.com/badges/divineniiquaye-php-rade/health.svg)](https://phpackages.com/packages/divineniiquaye-php-rade)
```

###  Alternatives

[popphp/popphp-framework

The Pop PHP Framework - Full Installation

686.5k1](/packages/popphp-popphp-framework)

PHPackages © 2026

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