CronCommand final class
Minn\Cli\CronCommand · public/minn/src/Minn/Cli/CronCommand.php · 277 lines
`wp cron`: the events, schedules, and spawn test a host and a fleet ask for. Every verb boots the full runtime first, so a plugin's schedules and callbacks are registered before an event is listed, scheduled, or run. The wording and exit codes are the reference's, captured from `wp cron` on the oracle; the two time columns drift second to second and are never pinned.
Constants and properties
| private | EVENT_FIELDS = array ( 0 => 'hook', 1 => 'next_run_gmt', 2 => 'next_run_relative', 3 => 'recurrence', ) | |
| private | SCHEDULE_FIELDS = array ( 0 => 'name', 1 => 'display', 2 => 'interval', ) |
Public
| method | event_list(array $args, array $assocArgs): void# | Lists the scheduled cron events. ## OPTIONS [--hook=<name>] [--field=<field>] [--fields=<fields>] [--format=<format>] [--<field>=<value>] [--due-now] |
| method | event_run(array $args, array $assocArgs): void# | Runs the next scheduled cron event for the given hook. ## OPTIONS [<hook>...] [--due-now] [--all] |
| method | event_schedule(array $args, array $assocArgs): void# | Schedules a new cron event. ## OPTIONS <hook> [<next-run>] [<recurrence>] [--<field>=<value>] |
| method | event_delete(array $args, array $assocArgs): void# | Deletes all cron events for the given hook. ## OPTIONS <hook>... |
| method | event_unschedule(array $args, array $assocArgs): void# | Unschedules all cron events for a given hook. ## OPTIONS <hook> |
| method | schedule_list(array $args, array $assocArgs): void# | Lists available cron schedules. ## OPTIONS [--field=<field>] [--fields=<fields>] [--format=<format>] |
| method | test(array $args, array $assocArgs): void# | Tests the WP Cron spawning system and reports the results. |
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | scheduled(array $crons, string $hook): bool# | Whether any instance of the hook is in the cron table. |
| private | eventArgs(array $assocArgs): array# | The event arguments passed as flags, the reference's own flags removed. @return array<string, string> |
| private | duration(int $seconds): string# | A number of seconds as the reference prints a recurrence: the two largest whole units, or "now". |
| private | relative(int $seconds): string# | The relative run time as the reference prints it: a duration ahead, or "now" once it is due. |
Nothing matches.