PHP: running scheduled jobs (cron jobs)

前端 未结 13 1803
自闭症患者
自闭症患者 2020-11-22 14:36

I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?

What I’ve thought out so far is having

13条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 14:59

    If you want something more abstract, you might consider using something like a PHP scheduler. For example:

    • https://github.com/lavary/crunz
    • https://github.com/peppeocchi/php-cron-scheduler

    And also, to parse the cron expression, you could use an existing library such as https://github.com/mtdowling/cron-expression. It provides a lot of useful methods to help you figure out information of a cron job.

    Hope that helps.

提交回复
热议问题