A modular PHP framework built on PSR contracts — small packages, sharp boundaries, no magic.
Hydra is a PHP framework assembled from independent, single-purpose packages. Each codes against an interface rather than its neighbours, and the split between framework mechanism and application policy is deliberate: the core defines contracts, the packages supply mechanism, and your app wires them together at the composition root.
The dependency graph flows downward — core knows nothing of the layers above it.
| Package | Role |
|---|---|
hydrakit/core |
Application object, container and service-provider contracts, typed environment loading. Interfaces only. |
hydrakit/http |
PSR-7 / PSR-15 HTTP layer: request lifecycle, routing, middleware pipeline. |
hydrakit/nyholm |
Nyholm PSR-7 / PSR-17 adapter — the default message and factory implementation. |
hydrakit/php-di |
PHP-DI PSR-11 adapter — the default container. |
hydrakit/kernel |
Default composition root and HTTP plumbing. |
hydrakit/session |
Session handling as PSR-15 middleware. |
hydrakit/database |
Thin PDO-based data layer. |
hydrakit/validation |
Zero-dependency input validation. |
hydrakit/view |
Native PHP templating. |
hydrakit/log |
PSR-3 logger. |
hydrakit/event |
PSR-14 event dispatcher and listener provider. |
hydrakit/auth |
Authentication over the HTTP and session packages. |
hydrakit/authorization |
Ability-based authorization on top of auth. |
hydrakit/csrf |
CSRF protection as middleware. |
hydrakit/console |
CLI surface, powered by Symfony Console. |
hydrakit/app |
Application skeleton — the composition root every project starts from. |
- PSR all the way down. HTTP messages, containers, middleware, logging, events, and factories speak the PHP-FIG standards.
- Contracts over concretes. Packages depend on interfaces; the app binds the implementations. Swapping one out is a one-line change at the composition root.
- Mechanism vs. policy. The framework provides the how; your application owns the what.
- Explicit beats implicit. No facades, no auto-discovery. If a service is available, you can point to the line that bound it.