tp5或thinkphp5执行shell命令定时执行命令行运行php脚本

tp5或thinkphp5执⾏shell命令定时执⾏命令⾏运⾏php脚本application\common.php⽂件内容如下:
return [
'app\shell\command\Test',
];
application\shell\command\Test.php内容如下:
namespace app\shell\command;
日内瓦协议
use think\console\Command;
国术联盟
use think\console\Input;
use think\console\Output;
use think\Db;
class Test extends Command
苯胺类化合物
{
protected function configure()
{
parent::configure();
$this->setName('Test')->setDescription('Test');
中国传媒
}
protected function execute(Input $input, Output $output)
{
阿托品试验
echo 'TestTestTestTest';exit;
}
}
切换到TP5根⽬录,即../application/上级⽬录(同级有个⽂件think)。
按住Shift键并且右击⿏标,选择‘在此处执⾏shell’。(或者直接cmd切换到该⽬录),执⾏如下命令:
F:\x\www\PHPTutorial\php\php-5.6. .\think Test
注:Test与下⾯的名称必须⼀致
振动与冲击setName('Test')

本文发布于:2024-09-23 10:30:48,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/153214.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:日内瓦   振动   协议
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议