- What is laminas/laminas-httphandlerrunner used for?
- It executes PSR-15 RequestHandlerInterface instances and emits the PSR-7 response they return through PHP's SAPI. In practice it lets you run middleware-style or request-handler-based applications without a full framework front controller. Laravel developers use it when they want to bridge PSR-15 handlers into a Laravel or serverless request lifecycle.
- How do I install laminas/laminas-httphandlerrunner with Composer?
- Run composer require laminas/laminas-httphandlerrunner. For Laravel projects, require it alongside your existing Laravel dependencies and check that your PHP platform satisfies the package constraint. Since 2.14.0 requires PHP 8.2 or newer, pin ^2.13 if you are still on PHP 8.1.
- Does laminas-httphandlerrunner integrate with Laravel middleware?
- It is not a Laravel-native middleware package, but its PSR-15 handlers can be wrapped or injected into Laravel's middleware pipeline. You can convert Laravel middleware to PSR-15 with Laminas Stratigility or adapt handlers at the boundary. This is useful for modular request handling, API-first services, or DDD-style handlers.
- Which PHP versions does laminas-httphandlerrunner 2.14.0 support?
- Version 2.14.0 raises the minimum PHP version to 8.2 and drops PHP 8.1 support. It retains PHP 8.5 compatibility from 2.13.0. Applications on PHP 8.1 must stay on 2.13.x or upgrade PHP before adopting 2.14.0.
- Is laminas-httphandlerrunner 2.14.0 a breaking change for PHP 8.1?
- Functionally it is a minor release, but dropping PHP 8.1 is effectively breaking for 8.1-bound applications. Composer's default ^2.x constraint can silently select 2.14.0 and then fail platform resolution or autoloading on PHP 8.1. Pin to ^2.13 for those apps until PHP 8.2+ is available.
- Can I use laminas-httphandlerrunner for AWS Lambda or Bref?
- Yes, it fits serverless and edge runtimes where PSR-15 handlers are already common. The package executes a RequestHandlerInterface and emits the response through PHP's SAPI, which Bref-style runtimes can bridge to their event model. Verify your runtime's PSR-7 implementation and emission expectations.
- How does laminas-httphandlerrunner emit PSR-7 responses?
- It takes the ResponseInterface returned by the request handler and emits its status, headers, and body through PHP's SAPI. That makes it a small bridge between PSR-7/PSR-15 code and native or emulated server environments. You remain responsible for constructing the request and choosing the emitter configuration.
- Do I need laminas/stratigility to use laminas-httphandlerrunner?
- No, stratigility is optional. The package only needs a PSR-15 RequestHandlerInterface; stratigility helps if you want to compose or convert middleware into PSR-15 pipelines. For a single handler or a Laravel-adapted handler, you can use it directly.
- How should I test PSR-15 handlers in a Laravel application?
- Unit-test handlers by passing PSR-7 requests and asserting on the returned PSR-7 responses. For integration coverage, exercise the Laravel route or kernel boundary that invokes the handler. This often means adding tests around the adapter rather than relying only on Laravel feature tests.
- What are alternatives to laminas-httphandlerrunner for running PSR-15 apps?
- Alternatives include framework-specific runners and other PSR-15 dispatchers, but many Laravel apps simply use Laravel's own HTTP kernel. Choose this package when you specifically need to execute PSR-15 handlers and emit PSR-7 responses. Check PHP version support and maintenance status before adopting.