class prune_forum extends base implements parametrized
Prune one forum cron task.
It is intended to be used when cron is invoked via web. This task can decide whether it should be run using data obtained by viewforum code, without making additional database queries.
Methods
string |
get_name()
Returns the name of the task. |
from base |
set_name(string $name)
Sets the name of the task. |
from base | |
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. |
|
__construct(string $phpbb_root_path, string $php_ext, config $config, driver_interface $db)
Constructor. |
||
set_forum_data(array $forum_data)
Manually set forum data. |
||
null |
run()
Runs this cron task. |
|
array |
get_parameters()
Returns parameters of this cron task as an array. |
|
null |
parse_parameters(request_interface $request)
Parses parameters found in $request, which is an instance of \phpbb\request\request_interface. |
Details
in base at line 34
public string
get_name()
Returns the name of the task.
in base at line 44
public
set_name(string $name)
Sets the name of the task.
at line 103
public bool
is_runnable()
Returns whether this cron task can run, given current board configuration.
This cron task will not run when system cron is utilised, as in such cases pruneallforums task would run instead.
Additionally, this task must be given the forum data, either via the constructor or parse_parameters method.
at line 116
public bool
should_run()
Returns whether this cron task should run now, because enough time has passed since it was last run.
Forum pruning interval is specified in the forum data.
at line 48
public
__construct(string $phpbb_root_path, string $php_ext, config $config, driver_interface $db)
Constructor.
at line 61
public
set_forum_data(array $forum_data)
Manually set forum data.
at line 71
public null
run()
Runs this cron task.
at line 127
public array
get_parameters()
Returns parameters of this cron task as an array.
The array has one key, f, whose value is id of the forum to be pruned.
at line 142
public null
parse_parameters(request_interface $request)
Parses parameters found in $request, which is an instance of \phpbb\request\request_interface.
It is expected to have a key f whose value is id of the forum to be pruned.