PHP 中的定时任务(类似 cron) [英] Timed Tasks (cron-like) in PHP

查看:28
本文介绍了PHP 中的定时任务(类似 cron)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有适用于 PHP 的全功能作业调度包?我正在寻找与 Java 的 Quartz 等效的 PHP.我很好地从 cron 外部触发了一些东西来驱动系统.我正在寻找的功能:

Is there a full featured, job scheduling package available for PHP? I'm looking for the PHP equivalent to Java's Quartz. I'm fine having things triggered externally from cron to drive the system. The functionality I'd be looking for:

  • 能够注册要在给定时间间隔调用的任务(类/方法).
  • 能够指定是否可以多次运行给定任务(在某些情况下不应多次运行可能长时间运行的方法).
  • 所有注册的条目/方法都可以并行运行(作业在后台运行,因此它们不会阻止其他定时任务).
  • 能够为给定任务设置超时.
  • 能够动态更新作业控制,例如,您可以禁用某些任务或更改其频率而无需更改代码.

我知道有很多问题要问,但这似乎是一批有用的功能,我认为有人可能已经将其中的一部分组合在一起.

I know it is a lot to ask, but it seems like a useful batch of features and I thought someone might have put together some portion of them.

如果这部分或其中的某些部分尚不存在,是否有任何指向将它们放在一起或具有其中某些子集的合理功能实现的开源项目的任何指示?

If this or some portion of this does not already exist, any pointers to putting one together or an open source project that has a reasonably featureful implementation of some subset of these?

推荐答案

一个快速的 google 出现了一些不错的结果:

A quick google turns up a few decent results:

实际上,如果您使用任何不错的共享主机包,您应该可以访问某种任务调度程序,无论是 Windows 的任务调度程序还是 *nix 下的 cron.我知道 DreamHost 至少允许用户级别的 crontab.

Really, though, if you're on any decent shared hosting package you should have access to some sort of task scheduler be it Windows' Task Scheduler or cron under *nix. I know DreamHost allows user level crontabs, at least.

这篇关于PHP 中的定时任务(类似 cron)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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