🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ##### 控制台掉用 ###### 不带参数调用 ~~~bash php think command ~~~ ###### 参数`Arguments`调用(只传值,用空格隔开;必传在前,选填在后) ~~~bash php think command args1 argsN... ~~~ ###### 选项`Options`调用(简称传参,全称接收;全称name和value中间有空格,简称空格可有可无) ~~~bash php think command --name1 "value1" --nameN "valueN" php think command -n1 "value1" -nN "valueN" ~~~ ###### 参数`Arguments`和选项`Options`混合调用(参数和选项传递顺序不分) ~~~bash php think command args1 argsN... --name1 "value1" --nameN "valueN" php think command --name1 "value1" --nameN "valueN" args1 argsN... php think command args1 argsN... -n1 "value1" -nN "valueN" args1 argsN... php think command -n1 "value1" -nN "valueN" args1 argsN... ~~~ ##### 代码调用 ~~~php use think\Console;#引入Console $output = Console::call('command');#无参数调用 $output = Console::call('command',[args1,args2,argsN...]);#带参数调用命令 $output = Console::call('test',['1','admin','-t2','-s3']);#带参数调用(options和arguments不区分顺序) return $output->fetch(); #获取输出信息 ~~~