Skip to content

phpgt/Cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

45b8052 · Apr 21, 2025
Mar 7, 2025
Sep 23, 2021
Mar 7, 2025
Mar 7, 2025
Nov 9, 2018
Feb 20, 2019
Nov 11, 2018
Mar 7, 2025
Apr 21, 2025
Mar 7, 2025
Mar 7, 2025
Mar 7, 2025
Mar 7, 2025
Mar 7, 2025

Repository files navigation

Run scripts or static functions at regular intervals.

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.


Build status Code quality Code coverage Current version PHP.Gt/Cron documentation

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.