問題描述
是否有適用于 PHP 的全功能作業(yè)調(diào)度包?我正在尋找與 Java 的 Quartz 等效的 PHP.我很好地從 cron 外部觸發(fā)了一些東西來驅(qū)動系統(tǒng).我正在尋找的功能:
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:
- 能夠注冊要在給定時間間隔調(diào)用的任務(wù)(類/方法).
- 能夠指定是否可以多次運行給定任務(wù)(在某些情況下不應(yīng)多次運行可能長時間運行的方法).
- 所有注冊的條目/方法都可以并行運行(作業(yè)在后臺運行,因此它們不會阻止其他定時任務(wù)).
- 能夠為給定任務(wù)設(shè)置超時.
- 能夠動態(tài)更新作業(yè)控制,例如,您可以禁用某些任務(wù)或更改其頻率而無需更改代碼.
我知道有很多問題要問,但這似乎是一批有用的功能,我認(rèn)為有人可能已經(jīng)將其中的一部分組合在一起.
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.
如果這部分或其中的某些部分尚不存在,是否有任何指向?qū)⑺鼈兎旁谝黄鸹蚓哂衅渲心承┳蛹暮侠砉δ軐崿F(xiàn)的開源項目的任何指示?
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 出現(xiàn)了一些不錯的結(jié)果:
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
實際上,如果您使用任何不錯的共享主機(jī)包,您應(yīng)該可以訪問某種任務(wù)調(diào)度程序,無論是 Windows 的任務(wù)調(diào)度程序還是 *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.
這篇關(guān)于PHP 中的定時任務(wù)(類似 cron)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!