PHPackages                             spajak/flow - 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. spajak/flow

ActiveLibrary

spajak/flow
===========

Simple PHP application base

0.9.1(2mo ago)033[1 PRs](https://github.com/spajak/flow/pulls)MITPHPPHP &gt;=8.4CI passing

Since Feb 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/spajak/flow)[ Packagist](https://packagist.org/packages/spajak/flow)[ RSS](/packages/spajak-flow/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (10)Versions (4)Used By (0)

Flow
====

[](#flow)

Simple PHP HTTP application base using:

- PSR-7 HTTP Message / PSR-17 HTTP Factories: [nyholm/psr7](https://github.com/Nyholm/psr7)
- PSR-15 HTTP Handlers / Middleware: [northwoods/broker](https://github.com/northwoods/broker)
- PSR-11: Container: [php-di/php-di](https://github.com/PHP-DI/PHP-DI)
- Routing: [nikic/fast-route](https://github.com/nikic/FastRoute)
- Console: [symfony/console](https://github.com/symfony/console)

Rationale
---------

[](#rationale)

- Basing on standardized interfaces and well tested components;
- Not being tied to any specific framework;
- Being able to make lightweight and customizable apps fast with just PHP's `include`s and anonymous functions.

Usage
-----

[](#usage)

```
$app = new Flow\Application;
```

Register services (using: [php-di/php-di](https://github.com/PHP-DI/PHP-DI)):

```
$services = [];
$services['hello'] = function() {
    return new class {
        public function sayHello($name) { return "Hello {$name}!"; }
    };
};
$app->getContainerBuilder()->addDefinitions($services);
```

Register routes (using: [nikic/fast-route](https://github.com/nikic/FastRoute)):

```
$app->getRouteCollector()->get('/hello[/{name}]', function($request, $name = 'World') use ($app) {
    $container = $app->getContainer();
    $response = $container->get('http_factory')->createResponse(200);
    $response->getBody()->write(
        $container->get('hello')->sayHello($name)
    );
    return $response;
});
```

Register console commands (using: [symfony/console](https://github.com/symfony/console)):

```
$app->getConsole()->register('hello')
    ->setDescription('Say hello')
    ->addArgument('name', null, 'Your name', 'World')
    ->setCode(function($input, $output) use ($app) {
        $service = $app->getContainer()->get('hello');
        $output->writeLn($service->sayHello($input->getArgument('name')));
    });
```

…or use factories to lazy-load commands:

```
use Flow\Command\RequestCommand;
use Flow\Emitter\ConsoleEmitter;

$commands = [];
$commands['request'] = function() use ($app) {
    return new RequestCommand(
        $app->getServerRequestCreator(),
        $app->getBroker(),
        new ConsoleEmitter
    );
}
$app->getCommandLoader()->addFactories($commands);
```

At the end of the script, simply run the application:

```
$app->run();
```

Try it from terminal:

```
$ php examples/application.php hello "Grim Reaper"
$ php examples/application.php request GET /hello
```

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance86

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Every ~377 days

Total

2

Last Release

69d ago

PHP version history (2 changes)0.9.0PHP &gt;=8.2

0.9.1PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/579cfadceb6c30283b191014fc7f46e7f32f3bf89ec09742c8fc4fa757e03f17?d=identicon)[spajak](/maintainers/spajak)

---

Top Contributors

[![spajak](https://avatars.githubusercontent.com/u/2893066?v=4)](https://github.com/spajak "spajak (25 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spajak-flow/health.svg)

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

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

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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