Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
wouterj commentedDec 29, 2016
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. |
ro0NL commentedDec 30, 2016
Agree. It'sjust 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. |
unkind commentedDec 30, 2016
@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 |
ro0NL commentedDec 30, 2016 • 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.
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 withLynx for example. |
unkind commentedDec 30, 2016 • 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.
How it is related to your PR? What stops you implementing all this stuff without having default in your config? |
ro0NL commentedDec 30, 2016
MrMitch commentedJul 25, 2017
Thanks for the effort@ro0NL |
MrMitch commentedJul 25, 2017
further discussion and investigation in#21027 |
Uh oh!
There was an error while loading.Please reload this page.
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 theREQUESTevent 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
SuspiciousOperationExceptionif things dont match.This can also be a user-land strategy, so im curious about SF adopting it.