Symfony HttpKernel
A structured, event-driven process for converting an HTTP Request into a Response in PHP.
Repository Health
Technical Analysis
The Symfony HttpKernel component provides a structured process for converting a Request into a Response by making use of the EventDispatcher component. It defines the request-handling lifecycle, a series of events from request to controller resolution, execution, view handling, response, and exception, that frameworks and applications hook into.
HttpKernel is flexible enough to create full-stack frameworks, micro-frameworks, or advanced CMS systems like Drupal. It supplies controller and argument resolvers, HTTP caching, fragment rendering, sub-request handling, a profiler, and the Kernel/Bundle infrastructure that forms the backbone of the Symfony framework.
What You Get
- An HttpKernel implementing the request-to-response lifecycle around the EventDispatcher
- Controller and argument resolvers that map requests to callables and their parameters
- Kernel and Bundle base classes plus dependency-injection integration for assembling applications
- A built-in HTTP reverse-proxy cache and Edge Side Includes fragment rendering
- Sub-request handling, exception handling, a data-collecting profiler, and a HttpKernelBrowser for functional testing
Common Use Cases
- Building a full-stack or micro-framework on top of the request-to-response lifecycle
- Hooking into kernel events to add authentication, logging, or response transformation
- Rendering page fragments and sub-requests with optional HTTP or ESI caching
- Functionally testing controllers by sending requests through the kernel with HttpKernelBrowser
Under The Hood
Architecture - HttpKernel.php orchestrates the flow: it dispatches kernel.request, resolves a controller via ControllerResolver, resolves its arguments via ArgumentResolver (kernel.controller/controller_arguments), invokes it, and dispatches kernel.view, kernel.response, kernel.finish_request, and kernel.exception as needed. Kernel.php adds the Bundle system and container compilation, HttpCache/ provides a reverse-proxy cache and ESI, and Fragment/ plus sub-request handling render composable page pieces. A Profiler and DataCollectors capture per-request diagnostics.
Tech Stack - Pure PHP under the Symfony\Component\HttpKernel namespace with PSR-4 autoloading, built on symfony/http-foundation and symfony/event-dispatcher and integrating symfony/dependency-injection and symfony/config. It is distributed as a read-only subtree split of the symfony/symfony monorepo.
Code Quality - The component ships an extensive PHPUnit suite covering the kernel lifecycle, resolvers, HTTP caching, fragments, and profiler, and adheres to Symfony’s strict coding standards and backward-compatibility promise, reflecting its role as the framework’s core.
API Design - The HttpKernelInterface (handle Request to Response) is elegantly minimal, while the surrounding event names, resolvers, and Bundle/Kernel abstractions form a deep but coherent extension surface. Its breadth gives it a steeper learning curve than leaf components, offset by thorough documentation and its ubiquity across the Symfony ecosystem.
Used by 3 apps in this directory
FreeScout
Customer Support
Run your own help desk and shared inbox — a fully self-hosted, open-source alternative to Zendesk and Help Scout with no per-agent fees.
Mautic
Automation · Marketing · Ecommerce
The world's largest open source marketing automation platform — own your data, run multi-channel campaigns, and escape vendor lock-in forever.
wallabag
Bookmarks Archiving
Self-hosted read-it-later app that saves clean, ad-free articles from any webpage for distraction-free reading across all your devices.