-
-
Notifications
You must be signed in to change notification settings - Fork 1
Examples
The example/ directory is the quickest way to see the library working without building a full project first.
Run an example from the repository root:
php example/01-run-due-jobs.phpEach script embeds its own crontab string so the schedule and the code stay together.
This example shows the smallest useful flow:
- create a
Queue - parse a crontab string into it
- run only the jobs due at a chosen time
It uses ScriptOutputMode::INHERIT so the command output is printed directly.
This example focuses on scheduling rather than execution.
It demonstrates:
- running the jobs due now
- asking the queue for the next run date
- asking the queue for the next command due
This is a good page to read after Running the runner if you want the underlying API shape.
This example shows that nickname schedules such as @hourly and @daily are accepted as the first token on a line.
It is a small, concrete demonstration of the nickname support described in Crontab syntax.
This example injects a custom ExpressionFactory that understands an extra @start token.
Read this alongside Custom expression factories if you want to extend the scheduler for your own project.
This example shows how to feed a few different crontab lines through CronExplainer.
It demonstrates:
- uppercase nickname expressions
- second-based schedules
- weekday lists
- nth weekday expressions with a month restriction
Read this alongside Crontab syntax or Running the runner if you want a quick way to check that a schedule says what you expect.
PHP.GT/Cron is a separately maintained component of PHP.GT/WebEngine.