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

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

问题描述

PHP是否有全功能的工作计划包?我正在寻找PHP等效于Java的 Quartz 。我很好地从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:


  • 能够以给定的时间间隔调用任务(类/方法)。

  • 能够指定给定任务是否可以多次运行(在某些情况下,可能长时间运行的方法不应多次运行)。

  • 所有注册的条目/方法可以并行运行(作业被背景化,因此它们不会阻止其他计时任务)。

  • 能够为给定任务设置超时。

  • 能够动态更新作业控制,例如,您可以禁用某些任务或更改频率而不更改代码。

  • Ability to register task (class/method) to be called at given intervals.
  • Ability to specify whether a given task can be run multiple times (potentially long running methods should not be run multiple times in certain cases).
  • All registered entries/methods could be run in parallel (jobs are backgrounded so that they do not block other timed tasks).
  • Ability to set a timeout for a given task.
  • Ability to update job control dynamically, so for instance you could disable some tasks or change their frequency without code changes.

我知道这是一个很多问题,但它似乎是一个有用的批次的功能,我认为有人可能会把他们的一些部分。

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.

如果这个或某些

推荐答案

一个快速的google会得到一些体面的结果:

A quick google turns up a few decent results:

  • http://www.bitfolge.de/pseudocron-en.htm
  • http://www.phpclasses.org/browse/package/4140.html
  • http://www.hotscripts.com/Detailed/61437.html

真的,如果你在任何不错的共享托管包,你应该可以访问某种任务调度程序是Windows的任务计划程序或cron下* nix。我知道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.

HTH

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

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