PHPackages                             hydrakit/kernel - 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. hydrakit/kernel

ActiveLibrary[Framework](/categories/framework)

hydrakit/kernel
===============

Default composition root and HTTP plumbing for the Hydra PHP framework

v0.2.0(yesterday)014—0%1MITPHP &gt;=8.2

Since Jul 2Compare

[ Source](https://github.com/hydra-foundation/kernel)[ Packagist](https://packagist.org/packages/hydrakit/kernel)[ RSS](/packages/hydrakit-kernel/feed)WikiDiscussions Synced today

READMEChangelogDependencies (12)Versions (4)Used By (1)

Hydra Kernel
============

[](#hydra-kernel)

The framework's default composition root and HTTP plumbing. It exists to keep the wiring that is identical across every Hydra app in **one place**, so a consumer's `AppServiceProvider` holds only *policy* — not the boilerplate that used to be copied into each app and drift.

What it ships
-------------

[](#what-it-ships)

- **`Kernel::application($container, $environment)`** — builds the shared composition root: binds the container and the app-constructed `Environment`(constructed once in the bootstrap, so `.env` is parsed exactly once per request), then registers the standard provider stack in the correct order (`Session` → `Event` → `Auth` → `Authorization`). Returns the `Application`so the app chains its own providers. Adding a framework package to the stack is now a one-line edit here that every consumer picks up on `composer update`.
- **`HttpServiceProvider`** — binds the invariant HTTP plumbing: the PSR-17 factories, the request provider, the emitter, the responder, the route cache, the router, the middleware pipeline, and the HTTP kernel. It takes the app's *policy* — the controller list, the middleware stack, the route-cache toggle and path — as plain constructor data, so it never needs to know an app's config types.

Using it
--------

[](#using-it)

A consumer's bootstrap collapses to composing these with its own provider:

```
public static function application(string $basePath): Application
{
    $container = new Container(new \DI\Container);
    $environment = new Environment($basePath); // .env parsed once, shared by all
    $routeCache = RouteConfig::fromEnvironment($environment)->cache;

    return Kernel::application($container, $environment)
        ->register(new HttpServiceProvider(
            controllers: AppServiceProvider::CONTROLLERS,
            middleware:  AppServiceProvider::MIDDLEWARE,
            routeCacheEnabled: $routeCache,
            routeCachePath: $basePath . '/bootstrap/cache/routes.php',
        ))
        ->register(new AppServiceProvider);
}
```

The app's `AppServiceProvider` then binds only what is genuinely its own: config value objects, the data layer, the user provider, the view, the logger, the two config-needing middleware (`ForceHttps`, `ErrorHandler`), and its event listeners.

The DI engine stays the app's choice
------------------------------------

[](#the-di-engine-stays-the-apps-choice)

`Kernel::application()` takes an already-built `ContainerInterface` rather than constructing one, so the app keeps ownership of its php-di (or other) container. The kernel wires providers into it; it does not pick it.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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 ~3 days

Total

3

Last Release

1d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hydrakit-kernel/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[cakephp/authentication

Authentication plugin for CakePHP

1214.1M106](/packages/cakephp-authentication)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.2k](/packages/typo3-cms-core)[windwalker/framework

The next generation PHP framework.

25740.3k1](/packages/windwalker-framework)[sunrise/http-router

A powerful solution as the foundation of your project.

17451.8k10](/packages/sunrise-http-router)

PHPackages © 2026

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