abstract class base implements task
Cron task base class.
Provides sensible defaults for cron tasks and partially implements cron task interface, making writing cron tasks easier.
At a minimum, subclasses must override the run() method.
Cron tasks need not inherit from this base class. If desired, they may implement cron task interface directly.
Methods
string |
get_name()
Returns the name of the task. |
|
set_name(string $name)
Sets the name of the task. |
||
bool |
is_runnable()
Returns whether this cron task can run, given current board configuration. |
|
bool |
should_run()
Returns whether this cron task should run now, because enough time has passed since it was last run. |
Details
at line 34
public string
get_name()
Returns the name of the task.
at line 44
public
set_name(string $name)
Sets the name of the task.
at line 57
public bool
is_runnable()
Returns whether this cron task can run, given current board configuration.
For example, a cron task that prunes forums can only run when forum pruning is enabled.
at line 68
public bool
should_run()
Returns whether this cron task should run now, because enough time has passed since it was last run.