Baldinof / roadrunner-bundle

A RoadRunner worker integrated in your Symfony app
MIT License
266 stars 47 forks source link

Is it available to use custom Requests/Responses? #146

Open sunlazor opened 4 weeks ago

sunlazor commented 4 weeks ago

Hello 👋 I'm trying to use Htmx with Symfony+Roadrunner but run into a problem. Htmx bundles change Request/Response objects and because of it they don't work with roadrunner-bundle. I tried https://github.com/tomcri/htmxfony with kernel and controller traits. Problem: requests are loosing POST parameters. I tried https://github.com/seaworn/symfony-htmx with request factory and controller trait. Problem: roadrunner-bundle do not call Request::create and therefore factory isn't triggered. Is there any way to make them work together?

praswicaksono commented 4 days ago

You can make your own implementation by implementing HttpFoundationWorkerInterface then swap current implementation in container using $service->register(HttpFoundationWorkerInterface::class, your-impl)

final class CustomHttpFoundationWorker implements HttpFoundationWorkerInterface 
{

}

you can copy paste current implementation in https://github.com/Baldinof/roadrunner-bundle/blob/3.x/src/RoadRunnerBridge/HttpFoundationWorker.php then just change toSymfonyRequest

Hope it help!