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
string get_name()

Returns the name of the task.

Return Value

string

Name of wrapped task.

at line 44
set_name(string $name)

Sets the name of the task.

Parameters

string $name

The task name

at line 57
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.

Return Value

bool

at line 68
bool should_run()

Returns whether this cron task should run now, because enough time has passed since it was last run.

Return Value

bool