phpgt / cron
Run scripts or static functions at regular intervals.
Fund package maintenance!
PhpGt
Installs: 2 706
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 3
Open Issues: 15
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-10-10 02:10:05 UTC
README
Define background jobs in standard crontab format and the Cron Runner will execute them when they are due. Jobs can be either normal scripts, or calls to static functions with automatic autoloading taken care of.
Example usage
crontab
file within your project directory:
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
Start the Runner: vendor/bin/cron
.
If you're using WebEngine, the Cron Runner is automatically started for you by running gt run
.