内容简介:Thinkphp的cron计划任务
1、使用方法
首先明白一点,thinkPHP中的计划任务不是真正意义上的,它是使用一个文件的修改时间差来比较是否执行,并且必须依赖网站的访问才能触发脚本
在conf下新建两个文件并配置tags.PHP和crons.PHP
配置tag.PHP
return array( 'app_end'=>array('/Behavior/CronRun'), // 定时任务 );
配置crons.PHP
return array( 'cron_1'=>array('cron1', '10') //cron1要执行的脚本 )
cron1默认在
Think<a href="https://www.52bz.la/tag/php" title="PHP" target="_blank">PHP</a>/Library/Cron/cron1.<a href="https://www.52bz.la/tag/php" title="PHP" target="_blank">PHP</a>
如果没有cron目录则新建一个,cron1.PHP自己所要执行的脚本
注意:
app_end的路径配置,
/Behavior/CronRun
路径要包含
/
否则不被认为是Behavior
如果报错Log::write相关错误,则打开
ThinkPHP/Library/Behavior/CronRunBehavior.class.<a href="https://www.52bz.la/tag/php" title="PHP" target="_blank">PHP</a>
大约55行
/Think/Log::write(implode('',$log));
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- SharePoint 配置PowerShell任务计划
- 教妹学Spring:Aware、异步编程、计划任务
- 教妹学 Spring:Aware、异步编程、计划任务
- 域渗透——利用GPO中的计划任务实现远程执行
- 域渗透——利用GPO中的计划任务实现远程执行
- BootDo 1.3.0 发布,新增数据字典、部门管理、计划任务
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Algorithms on Strings, Trees and Sequences
Dan Gusfield / Cambridge University Press / 1997-5-28 / USD 99.99
String algorithms are a traditional area of study in computer science. In recent years their importance has grown dramatically with the huge increase of electronically stored text and of molecular seq......一起来看看 《Algorithms on Strings, Trees and Sequences》 这本书的介绍吧!