问题
When you're using the Laravel PHP Framework, is there a way, (at runtime), to programmatically fetch a list of currently configured and available artisan
commands? I'm basically looking for way to know
All the command names
The class or objects that corresponds to that class
回答1:
As usual, self help desk strikes as soon as I ask myself the question clearly.
//app()->make('artisan')->all();
foreach(Artisan::all() as $key=>$command)
{
var_dump($key);
var_dump(get_class($command));
}
来源:https://stackoverflow.com/questions/27279294/getting-a-list-of-artisan-commands-programmatically