fluffydiscord/rapira-symfony-bundle
A Symfony bundle that simplifies Rapira integration with autoconfiguration, dependency injection service wiring, and convenient client services. Install via Composer, configure your credentials, and start building Rapira-powered features quickly.
Install: composer require fluffy-discord/rapira-symfony-bundle. As of v0.2.1 the bundle requires the stable rapira/contract ^0.9.1, so you no longer need "minimum-stability": "dev" in composer.json — if you added that flag for 0.2.0, remove it.
Wire the runtime class (this is also step 1 of the 0.1.x upgrade path, so do it explicitly even on a fresh install):
composer config extra.runtime.class 'FluffyDiscord\RapiraBundle\Runtime\Runtime'
composer dump-autoload
If this is missing, the app boots through the normal front-controller runtime and you'll get FPM-like behaviour instead of worker mode — a very confusing "nothing changed" symptom.
Point Rapira at your front controller. In rapira.toml:
[http.pool]
entrypoint = "public/index.php"
mode = "dispatcher"
The vendored worker.php is gone; public/index.php serves both FPM/dev and worker mode.
Where to look first: the bundle's FluffyDiscord\RapiraBundle\Runtime\Runtime class (that's the seam everything goes through), your rapira.toml pool block, and public/index.php — confirm nothing in the front controller echoes or exits before the runtime takes over.
First use case: run an existing app under Rapira and smoke-test the four things 0.2.0 rewrote — a multipart/form-data POST with a real file upload, a zero-byte upload, a cookie-carrying request, and a session write followed by a session read on a different worker request. Those are exactly the areas that regressed in 0.1.x.
public/index.php side-effect free and identical between FPM and worker mode; do environment switching in config, not in the front controller. This makes "does it break under Rapira?" a one-line diff to debug.[http.pool]. Anything still writing [pool] (entrypoint/mode) is 0.1.x syntax and will not boot on 0.2.x. Keep the mode = "dispatcher" key — the dispatcher runner is the path that got the PHP 8.4 fix.disconnect() per request, don't cache a PDO/Connection object somewhere the bundle can't see, and don't wrap requests in a transaction you might not commit.kernel.terminate listeners, which makes the "move the temp file after the response is flushed" pattern viable. Beyond terminate, assume the temp file is gone.php://input, normalised $_FILES keys, or called ob_end_clean() defensively.$_SERVER['HTTP_*'] parsing and don't trust client-supplied duplicates.public/index.php, running the same request through php -S/FPM is the fastest way to isolate whether a bug is yours or the worker layer's.HttpKernel/Symfony Runtime. Laravel is not a Symfony HttpKernel app, so there is no drop-in path — you'd be writing an adapter around Illuminate\Foundation\Http\Kernel yourself. For most Laravel teams, Octane is the lower-risk route; treat this package as interesting-but-not-yet-day-to-day for Laravel specifically.worker.php is deleted, (2) [pool] became [http.pool] with entrypoint = "public/index.php", (3) extra.runtime.class must be set and the autoloader dumped. Miss any one and you get a boot failure or a silently non-worker-mode app.0.2.x is still a moving target and rapira/contract is pinned at ^0.9.1. Pin exact versions in composer.json and re-read release notes on every bump.SET/USE at drop time is your problem. Set MySQL/MariaDB wait_timeout sensibly and never leave a transaction open across a request boundary.kernel.terminate is the Symfony event. If you're porting Laravel code, the equivalent hooks are terminable middleware and app()->terminating(). Verify uploads survive into those on your setup before deleting the in-request file handling — the release note guarantees the Symfony event, not Laravel's.extra.runtime.class set, (2) is the pool block [http.pool] with public/index.php, (3) is there output/session state being written before the runtime boots, (4) does the failure only appear on the second request to the same worker (classic state-leak signal).files[]-style array field names were explicitly broken and fixed; add them to your smoke suite, they regress easily.How can I help you explore Laravel packages today?