application\command.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.27-nts\php.exe .\think Test
注:Test与下面的名称必须一致
setName('Test')
没有合适的资源?快使用搜索试试~ 我知道了~
tp5执行shell命令定时执行命令行运行php脚本
共1个文件
txt:1个
需积分: 5 0 下载量 172 浏览量
2023-05-13
16:25:46
上传
评论
收藏 719B RAR 举报
温馨提示
tp5或thinkphp5执行shell命令定时执行命令行运行php脚本
资源推荐
资源详情
资源评论
收起资源包目录
tp5或thinkphp5执行shell命令定时执行命令行运行php脚本.rar (1个子文件)
tp5或thinkphp5执行shell命令定时执行命令行运行php脚本.txt 922B
共 1 条
- 1
资源评论
ha891120
- 粉丝: 2
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功