-
-
Notifications
You must be signed in to change notification settings - Fork 142
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace server request via inheritance #359
Conversation
@alexpts Thanks for filing this PR! I'm not a big fan of exposing these classes and using inheritance to override internal behavior, but perhaps I'm missing some context. The motivation is currently unclear, what exactly is gained by using a different PSR-7 implementation here? It's currently my understanding a middleware implementation would be the preferred approach if you need a specific implementation. |
Nothing changes architecturally. But this allows you to use another implementation that suits the project more.I do not need to make a bridge from default request to other request. It possible configure react/http for different preferences. I think it’s not necessary to use inheritance. I can propose an option without inheritance that will allow me to set a parser. Example: $server = new StreamingServer($app);
$server->setParser($customRequestParser);
$server->listen(new \React\Socket\Server(9000, $loop)); Think it is will be better. What do you think about? |
I think the preferred way would be to use a You'd preferable expose the option to set a factory in the constructor, which would be passed down to the parser. |
Did you run into specific issues that you want to go for this?
Was personally thinking along the lines of:
This would have my preference to be honest, loving the idea of custom request parsers, but that seems overkill for the implied issue at hid |
It seems like this pull request is open for quite a while now and didn't receive any updates since. Last comment is over a year old and I want to avoid pull requests laying around for too long without any further communication, so I'd suggest we close this for now. If this topic is still relevant and needs some further investigation, we can always reopen it in the future and take another look 👍 If there are no objections I will come back and close this after a few days. |
Added the ability to replace server request via inheritance.
This will make it possible to use a different psr7 implementation for
ServerRequestInterface