yii2中控制器controllers如何触发yii2的console。 [ 2.0 版本 ]
除了定时器跑任务。。。我现在能想到的是用php的exec函数跑命令。。。不知有没有人研究过这一块,希望有用过的大神指点一下。万分感谢!
共 2 个回答
-
$last_line = exec('ping 127.0.0.1 -n 4', $arr); //$arr=["Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),","Approximate round trip times in milli-seconds:","Minimum = 158ms, Maximum = 192ms, Average = 175ms"]; //$last_line="Minimum = 158ms, Maximum = 192ms, Average = 175ms";
共 1 条回复liluoao 觉得很赞
pmd 上海
注册时间:2015-12-08
最后登录:2024-01-15
在线时长:71小时5分
最后登录:2024-01-15
在线时长:71小时5分
- 粉丝60
- 金钱3318
- 威望70
- 积分4728