cohete / framework
Async PHP framework built on ReactPHP and RxPHP
v0.1.0
2026-03-12 18:26 UTC
Requires
- php: >=8.2
- evenement/evenement: ^3.0
- fig/http-message-util: ^1
- for/http-middleware-psr15-adapter: ^2.0
- middlewares/client-ip: ^2.0
- monolog/monolog: ^3.5
- nikic/fast-route: ^1.3
- php-di/php-di: ^7.0
- react/event-loop: ^1.5
- react/http: ^1.9
- react/promise: ^3.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-03-18 14:15:44 UTC
README
Async PHP framework built on ReactPHP and RxPHP. ~600 LOC.
Installation
composer require cohete/framework
What's included
- Kernel - HTTP request dispatcher with FastRoute
- Router - JSON-based route definitions
- ReactHttpServer - Non-blocking HTTP server on ReactPHP
- ContainerFactory - PHP-DI container with sensible defaults
- MessageBus - Async event bus (EventBus, CommandBus, QueryBus)
- JsonResponse - Response factory for JSON APIs
- Middleware - Request/Response dumpers for debugging
Quick start
$container = ContainerFactory::create([ TodoRepository::class => fn() => new InMemoryTodoRepository(), ]); $kernel = new Kernel($container, __DIR__ . '/routes.json'); ReactHttpServer::init( host: '0.0.0.0', port: '8080', kernel: $kernel, loop: Loop::get(), );
See cohete/skeleton for a full working example.
License
MIT