CakePHP上的计划任务 [英] Sheduled Task on CakePHP

查看:268
本文介绍了CakePHP上的计划任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在 CakePHP 3.2 项目上工作。

Hi everyone i work on CakePHP 3.2 Project..

我有一个属性 Entity ..

I have a Property Entity..

当用户创建属性时,管理员必须将其验证为活动。 。
之后,我在 date_of_expiration 字段中输入当前日期+ 10天,例如...

when a user creates a property, the admin must validate it to become active.. After that i put in field called date_of_expiration the current date + 10 days for example ...

我想要的是这个属性在此日期(当前日期+ 10天)过期。通过更改状态 strong>活动更改为无效

What i want is that this property expires in this date (current date + 10 day).. By changing a field called status from active to inactive..

我在Google中搜索,发现i nead称为

I searched in Google and i found that what i nead called Sheduled Task..

我问在CakePHP 3.2中做最好的方法。

I ask about the best way to do this in CakePHP 3.2

我..

推荐答案


  1. 创建Shell ,使用该函数查找过期的属性并将值更改为非活动状态。

  2. 从CronJob运行Shell 每天00:00:00

  1. Create Shell with the function to find an expired property and change the value to inactive.
  2. Run Shell from CronJob every day at 00:00:00

这篇关于CakePHP上的计划任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆