You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could create a CliRequest that when injected into the Router instead of the traditional Request could route things via Cli calls. Bash and linux are somewhat RESTful. An experimental mocked cli request is in the Router test suite for a long time now, but it isn't very friendly for users.
Considering a $r->get('/users/*', 'MyUsersController') sample route, both a HTTP GET /users/alganet and a php application.php get users alganet cli route should route to the same point. Custom route verbs could be used, such as $r->install('/', 'MyInstallController');.
Much of the code from the current Request class would be moved to an AbstractRequest that would be extended to both Request and CliRequest.
The text was updated successfully, but these errors were encountered:
I'm willing to do this. There are a couple of things to figure out before then:
The path and method can be abstracted as words: get users alganet == GET /users/alganet
Query string options can be abstracted as getopts get users --since=2009 == GET /users/?since=2009, though Respect\Rest will not abstract that for you. You'll need to do that on the route implementation. Additional ->env("cli"), ->env("http" and ->env("cgi" can be added as routines to improve abstraction without increasing coupling.
Mime negotiation could be abstracted to bash negotiation or something like this. Language negotiation can be done using env vars. A lot of thinking on how that could work is needed.
Just to make clear: this issue doesn't cover transparent HTTP/bash mapping. It allows developers to do that by providing tools to serve content in both HTTP and bash, as they're both RESTful.
We could create a CliRequest that when injected into the Router instead of the traditional Request could route things via Cli calls. Bash and linux are somewhat RESTful. An experimental mocked cli request is in the Router test suite for a long time now, but it isn't very friendly for users.
Considering a
$r->get('/users/*', 'MyUsersController')
sample route, both aHTTP GET /users/alganet
and aphp application.php get users alganet
cli route should route to the same point. Custom route verbs could be used, such as$r->install('/', 'MyInstallController');
.Much of the code from the current Request class would be moved to an AbstractRequest that would be extended to both Request and CliRequest.
The text was updated successfully, but these errors were encountered: