front-interop / impl
Reference implementations for Front-Interop.
Requires
- php: >=8.4
- front-interop/interface: 1.x@dev
Requires (Dev)
- pds/composer-script-names: ^1.0
- pds/skeleton: ^1.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- pmjones/php-styler: 0.x@dev
This package is auto-updated.
Last update: 2026-05-08 13:20:53 UTC
README
Reference implementations of the Front-Interop interface for PHP 8.4+.
These implementations are intentionally naive — they exist to showcase the FrontController contract itself. Production front controllers would be obtained from an IoC container and would compose a request/response system, a router/dispatcher, a robust error handler, and so on.
Installation
composer require front-interop/impl
Usage
Three reference implementations cover three execution contexts.
ConsoleFrontController
A typical command-line console front controller, reading $argv and writing
to injected $stdout/$stderr resources.
php bin/hello.php World
RequestFrontController
A typical HTTP front controller, reading $_GET and emitting HTML.
Run composer hello at the package root, then visit:
http://localhost:8080/index.php?name=World
FrankenFrontController
A specialized front controller for FrankenPHP, wrapping a
RequestFrontController in a frankenphp_handle_request() worker loop
bounded by an optional maximum request count (0 for unbounded).
Classes
| Interface | Implementation |
|---|---|
| FrontController | ConsoleFrontController, RequestFrontController, FrankenFrontController |
All classes are in the FrontInterop\Impl namespace.
See the Front-Interop interface package for the full specification.