$ show symfony/http-kernel
This is the Symfony HttpKernel component, a PHP library that provides the core request-to-response pipeline for the Symfony framework. It implements an event-driven architecture where the kernel dispatches events (REQUEST, CONTROLLER, CONTROLLER_ARGUMENTS, VIEW, RESPONSE, EXCEPTION, FINISH_REQUEST, TERMINATE) that listeners can modify. The library includes controller resolution, argument injection via a chain of value resolvers, HTTP caching (reverse proxy with ESI/SSI support), profiling and debugging infrastructure, rate limiting, locking, serialization, and attribute-based configuration. It is not a standalone application but a library used by Symfony applications and any PHP project needing a robust HTTP kernel.
The LLM identified 3 files worth highlighting for reuse:
Implements ValueResolverInterface to resolve DateTimeInterface controller arguments. Uses the #[MapDateTime] attribute to configure format and timezone. The resolver checks request attributes and query parameters, normalizes the value, and creates the appropriate DateTime object. It is self-contained, requiring only the ValueResolverInterface and a few Symfony support classes, and could be extracted into a standalone library for automatic datetime conversion in any PHP HTTP framework.
Implements ResponseCacheStrategyInterface to merge cache headers from multiple responses (e.g., ESI fragments). It handles max-age, s-maxage, expires, public/private, vary, ETag, Last-Modified, stale-while-revalidate, stale-if-error, and cache status headers. The strategy is purely algorithmic and only depends on Symfony's Response object, making it highly reusable in any HTTP caching context where multiple responses need to be combined.
Provides file-based persistence for HTTP cache entries. It implements StoreInterface and handles reading, writing, purging, locking, and support for Vary headers. The store creates separate cache entries for different request attributes (e.g., User-Agent) and uses locks to prevent cache stampede. It is a standalone implementation that could be reused as a file-based cache backend in other PHP projects, with minimal dependencies on Symfony's filesystem component.