Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Runtime] add middleware to frankenPhp runner#62130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Conversation
carsonbot commentedOct 22, 2025
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
carsonbot commentedOct 22, 2025
Hey! Thanks for your PR. You are targeting branch "7.4" but it seems your PR description refers to branch "7.4 for features / 6.4, 7.3 for bug fixes". Cheers! Carsonbot |
a3fcf78 to9da81f0CompareUh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Tests/FrankenPhpWorkerRunnerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
With such middleware API that can run logic before and after our processing but without any access to the request and response (any logic running after the original handler even runs after the response has been sent), I don't see any use case that would be able to reuse that besides the Tideways profiling use case. @beberlei is there any plan for Tideways to intrument the FrankenPHP worker mode natively, making this PR useless ? |
src/Symfony/Component/Runtime/Runner/Middleware/MiddlewareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ec7df4d to48840edCompareCo-authored-by: Oskar Stark <oskarstark@googlemail.com>
48840ed tofd4cfa2CompareAppreciate the feedback,@OskarStark and@stof. |
4e6f02a to37d6d79Comparenicolas-grekas commentedOct 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This looks too specific to frankenphp and unndeeded I think: it should be possible to decorate the runtime to do this without introducing any new concept (middleware). |
| publicfunction__construct( | ||
| privateHttpKernelInterface$kernel, | ||
| privateint$loopMax, | ||
| privateiterable$middlewares = [], |
nicolas-grekasOct 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looking again at the patch, there might be a simpler solution:
| privateiterable$middlewares =[], | |
| private?\Closure$handler =null, |
then$handler ??= frankenphp_handle_request(...)
Uh oh!
There was an error while loading.Please reload this page.
Likephp-runtime/runtime#183
We use tideways in our projects.
We want to use this middleware to enable the request based profiling.
https://support.tideways.com/documentation/setup/installation/frankenphp.html#code-changes-to-frankenphp_handle_request-callback
I want to use a middleware for tideways like this: