Skip to content

Custom expressions and running tasks now

Latest

Choose a tag to compare

@g105b g105b released this 07 Jul 14:27
15ec732

This release makes the runner more useful during development, and opens up the schedule parser for project-specific behaviour.
We can now use custom ExpressionFactory implementations to teach the parser extra schedule tokens, such as @start, while still falling back to ordinary cron expressions. The built-in parser also accepts nickname schedules including @hourly, @daily, @weekly, @monthly, @yearly, and @annually.

The crontab syntax now supports second-precision schedules with an s suffix in the first field:

  • */10s * * * * hello

That runs hello every 10 seconds, which is useful for local development, short-running workers, or jobs where minute precision is not enough.

The CLI has gained a more targeted --now mode. We can still run every task immediately:

  • vendor/bin/cron --now

Or run one named job by its displayed command name:

  • vendor/bin/cron --now hello

This works well with --watch, so a single job can be triggered once before the normal schedule continues.

Runner output is also clearer. It now prints the current time, shows the next job name, and includes the UTC time when the local timezone is not UTC. The runner detects the system timezone from TZ, /etc/localtime, or /etc/timezone.

Other improvements include better command display names for scripts, static methods, and query-string script calls; corrected alias loading for go() scripts; updated examples; and updated development tooling, including PHP_CodeSniffer 4 support.