Scheduler
class Scheduler (View source)
Methods
Create a Scheduler instance
No description
Set the PHP script file used to execute background commands (eg.: /foo/bar/foo.php %s)
If enabled, background tasks will be triggered before the others
Set directory used to store:
Executes a named task
Runs every due task. This method must be executed during all CRON/schedule calls.
Details
__construct()
Create a Scheduler instance
__destruct()
No description
setBackgroundTaskDispatcher(string $dispatcher)
Set the PHP script file used to execute background commands (eg.: /foo/bar/foo.php %s)
prioritizeBackgroundTasks(bool $enable)
If enabled, background tasks will be triggered before the others
setStorage(string $dir)
Set directory used to store:
- Lock file is used to prevent repeated executions.
- State file is used to check if a task has already been executed.
setTimeZone(DateTimeZone $timeZone)
Set timeZone used to control task states
Task
call(string $name, callable $callback)
Register a callback function to execute
Task
command(string $name, Command $command, array $options = array())
Register a Console command from system/console.php to execute
Task
shell(string $name, string $command)
Register a shell command to execute
int
runTask($name)
Executes a named task
int
exec()
Runs every due task. This method must be executed during all CRON/schedule calls.