phpgt / cron
此包最新版本(v1.0.3)无可用许可证信息。
定期运行脚本或静态函数。
v1.0.3
2021-09-23 10:47 UTC
Requires
- php: >=7.4
- dragonmantank/cron-expression: ^2.2
- phpgt/cli: 1.*
Requires (Dev)
- phpstan/phpstan: >=0.12.64
- phpunit/phpunit: 9.*
- dev-master
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.4.0
- v0.3.1
- v0.3.0
- v0.2.1
- v0.2.0
- v0.1.0
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-dependabot/composer/phpunit/phpunit-9.6.5
- dev-dependabot/composer/phpstan/phpstan-1.10.6
- dev-dependabot/composer/dragonmantank/cron-expression-3.3.2
- dev-11-background-start
- dev-circleci
- dev-actions
- dev-7-specify-jobs
This package is auto-updated.
Last update: 2024-09-10 02:01:22 UTC
README
使用标准crontab格式定义后台作业,Cron Runner将在作业到期时执行它们。作业可以是普通脚本,也可以是调用静态函数,自动加载由Cron Runner处理。
示例用法
项目目录下的 crontab
文件
00 * * * * ExampleClass::hourlyTask()
0 22 * * 1-5 YourApp\Accounts\Daily::nightRoutine("you can pass properties too!")
# This is a comment. The above job will run at 10pm Mon-Fri.
*/10 * * * * ExampleClass::runEveryTenMinutes
启动Runner: vendor/bin/cron
。
如果你使用 WebEngine,则可以通过运行 gt run
自动启动Cron Runner。