問題描述
是否有適用于 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:
- http://www.bitfolge.de/pseudocron-en.htm
- http://www.phpclasses.org/browse/package/4140.html
- http://www.hotscripts.com/Detailed/61437.html
實際上,如果您使用任何不錯的共享主機包,您應該可以訪問某種任務調度程序,無論是 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)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!