-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[POC] Introcude the request on CLI by default #21101
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
Conversation
Commands talk with the terminal, not HTTP land. I cannot see why having a HTTP land object in here is usefull. And I really can't see the usefullness if it's all just based on defaults configured in the configuration. These can be turned into parameters, which the command can use instead. |
Agree. It's just a defaulting stategy for that matter. Technically we dont talk HTTP, we dont call But i understand you concern, as it looks like we're crossing semantics, but it's really just a service. Anyway, the asset+framework need a integration regarding this (imo). Not sure it should be an unsupported feature, but it could. And im not sure, how common using sub paths is anyway, i dont do it. |
@ro0NL default values is not always advantage, this kind of design may lead to unwanted behaviour. Often, fail-fast strategy is way more practical: let CLI-services with |
Agree, semantics get a big vague'ish here.
Undertstand, it should be properly adapted. If adapted at all. It's really just a proposal how things can be done for that matter.
Again, im not overseeing all the side effects here... but we dont talk HTTP. So im not sure what im overlooking. And to go fully crazy; this would allow for your own appliction curl command (doing response introspection from CLI). I would never leave CLI i guess :) We make everything useful, even without a webserver / webbrowser. This allows integration with Lynx for example. |
How it is related to your PR? What stops you implementing all this stuff without having default in your config? |
Thanks for the effort @ro0NL |
further discussion and investigation in #21027 |
TLDR; it works.
This introduces a concept of having a request object on CLI. And it truly seems to be convenient.
The idea is to push a static request (
Request::create
) to the request stack, this fixes an issue in a way we have a (imo.) good defaulting strategy (things just work). No need for introducing context objects, additional class properties storing defaults, etc.To be clear, this is not about actually calling
Kernel::handle($request)
on CLI. However, in a way, we do have to consider theREQUEST
event on this.I did a quick setup for config proposal.
Additionally, when dealing with a "real" request we could opt-in to validate it against our definition, and perhaps throw a
SuspiciousOperationException
if things dont match.This can also be a user-land strategy, so im curious about SF adopting it.