maduser / argon-http
HTTP kernel and response emitter for the Argon runtime stack.
Requires
- php: ^8.2
- maduser/argon-http-message: ^1.0
- maduser/argon-prophecy: ^1.0.2
- maduser/argon-support: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^3.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.1
- phpunit/phpunit: ^11.5
- slevomat/coding-standard: ^8.24
- squizlabs/php_codesniffer: ^4.0
- vimeo/psalm: ^6.13
This package is auto-updated.
Last update: 2026-05-24 14:39:30 UTC
README
maduser/argon-http is the HTTP runtime adapter for Argon applications. It
provides the kernel and response emitter that Prophecy can use after the
container, routing, middleware, and error packages have been registered.
The package is intentionally small:
Kernelruns the HTTP request lifecycle.ResponseEmitteremits PSR-7 responses to SAPI.HttpKernelServiceProviderbinds the kernel and emitter into anArgonContainer.
It does not define routes, build middleware stacks, format exceptions, or create PSR-7 messages. Those responsibilities belong to the routing, middleware, error, and HTTP message packages.
Installation
composer require maduser/argon-http
For a complete HTTP stack, applications normally combine this package with:
maduser/argon-prophecymaduser/argon-http-messagemaduser/argon-routingmaduser/argon-middlewaremaduser/argon-error
Service Provider
Register the HTTP provider during application boot:
use Maduser\Argon\Container\ArgonContainer; use Maduser\Argon\Http\Provider\HttpKernelServiceProvider; $container = new ArgonContainer(); $container->register(HttpKernelServiceProvider::class);
The provider binds:
Maduser\Argon\Contracts\Handler\AppHandlerInterfacetoKernelPsr\Http\Message\ServerRequestInterfacethrough the HTTP message server-request factoryMaduser\Argon\Support\Contracts\ResponseEmitterInterfacetoResponseEmitter
The server request binding is only registered when the application has not already provided one. It uses a normal factory binding, not a closure, so the container can still be compiled. This keeps tests, workers, and custom front controllers in control while giving normal SAPI front controllers a useful default.
The kernel expects the container to resolve a RequestHandlerInterface. In the
full Argon HTTP stack that is usually provided by maduser/argon-routing and
maduser/argon-middleware.
Exit Behaviour
By default the provider sets kernel.shouldExit from the runtime environment:
APP_ENV=testingdisables hard exits.- all other environments allow the kernel to exit after emitting a response.
Applications can set kernel.shouldExit before registering the provider to
override that default.
Error Handling
The HTTP kernel deliberately does not catch or format exceptions. Runtime throwables are coordinated by Prophecy and the error package so the kernel stays focused on three operations:
- process the request through a PSR-15 request handler;
- emit the returned PSR-7 response;
- terminate with an exit code derived from the response status.