Manual
Frameworks
One adapter per framework; your application runs unchanged.
Introduction#
An adapter turns a framework's own request handling into a Swerve\RequestHandler, so the application's code, routes and views run unchanged; swerve.php becomes the entry point instead of public/index.php. See the frameworks section for which ones have an adapter and what each one covers.
Concepts#
- Designing a framework for concurrent requests – A boot phase that ends, a container that closes, a scope per request, and reset hooks only as a last resort.
- Case study: Laravel – What Laravel keeps in shared state, how the Swerve adapter handles it, and what the same state needs from your code.
- Laravel: the container and facades – Registrations and fakes made during a request stay on shared objects. Register at boot; fake in tests.
- Laravel: views, translator, router and paginator – Shared view data, translator lines and library pointers: set them at boot, pass the rest with the call.
- Laravel: toggles, macros and process settings – Gate and macro registrations, static switches like Carbon::setTestNow(), and the settings PHP keeps per process.
- Laravel: static caches – Which of Laravel's own static caches are memoization, whether they are bounded, and what flushes them.
Guides#
- Laravel – Run a Laravel application on Swerve: many requests at once, each in a pooled application of its own.
- Symfony – Run a Symfony application on Swerve: one kernel per in-flight request, booted once and kept warm.
- CodeIgniter – Run a CodeIgniter 4 application on Swerve through its own worker mode, one request at a time per worker.
- CakePHP – Run a CakePHP 5 application on Swerve: booted once per worker, one request at a time, like PHP-FPM.
- Yii – Run a Yii 3 application on Swerve, one request at a time per worker.
- Laminas – Run a Laminas MVC or Mezzio application on Swerve. MVC rebuilds the application per request and serializes it; Mezzio runs concurrently.
- PSR-15 – Run Slim, Mezzio or your own PSR-15 handler on Swerve with the swerve-psr15 adapter: one boot per worker, requests overlap.