class wrapper

Cron task wrapper class.

Enhances cron tasks with convenience methods that work identically for all tasks.

Properties

protected helper $routing_helper
protected task $task
protected string $phpbb_root_path
protected string $php_ext
protected template $template

Methods

__construct(task $task, helper $routing_helper, string $phpbb_root_path, string $php_ext, template $template)

Constructor.

bool
is_parametrized()

Returns whether the wrapped task is parametrised.

bool
is_ready()

Returns whether the wrapped task is ready to run.

string
get_url()

Returns a url through which this task may be invoked via web.

string
get_html_tag()

Returns HTML for an invisible img tag that can be displayed on page load to trigger a request to the relevant cron task endpoint.

mixed
__call($name, $args)

Forwards all other method calls to the wrapped task implementation.

Details

at line 60
__construct(task $task, helper $routing_helper, string $phpbb_root_path, string $php_ext, template $template)

Constructor.

Wraps a task $task, which must implement cron_task interface.

Parameters

task $task

The cron task to wrap.

helper $routing_helper

Routing helper for route generation

string $phpbb_root_path

Relative path to phpBB root

string $php_ext

PHP file extension

template $template

at line 77
bool is_parametrized()

Returns whether the wrapped task is parametrised.

Parametrized tasks accept parameters during initialization and must normally be scheduled with parameters.

Return Value

bool

Whether or not this task is parametrized.

at line 90
bool is_ready()

Returns whether the wrapped task is ready to run.

A task is ready to run when it is runnable according to current configuration and enough time has passed since it was last run.

Return Value

bool

Whether the wrapped task is ready to run.

at line 104
string get_url()

Returns a url through which this task may be invoked via web.

When system cron is not in use, running a cron task is accomplished by outputting an image with the url returned by this function as source.

Return Value

string

URL through which this task may be invoked.

at line 121
string get_html_tag()

Returns HTML for an invisible img tag that can be displayed on page load to trigger a request to the relevant cron task endpoint.

Return Value

string

HTML to render to trigger cron task

at line 137
mixed __call($name, $args)

Forwards all other method calls to the wrapped task implementation.

Parameters

$name
$args

Return Value

mixed