phpBB API Documentation
Class

phpbb\cron\manager

class manager

Cron manager class.

Finds installed cron tasks, stores task objects, provides task selection.

Methods

__construct(array|Traversable $tasks, string $phpbb_root_path, string $php_ext)

Constructor.

null load_tasks(array|Traversable $tasks)

Loads tasks given by name, wraps them and puts them into $this->tasks.

wrapper|null find_one_ready_task()

Finds a task that is ready to run.

array find_all_ready_tasks()

Finds all tasks that are ready to run.

wrapper find_task(string $name)

Finds a task by name.

array get_tasks()

Find all tasks and return them.

wrapper wrap_task(task $task)

Wraps a task inside an instance of \phpbb\cron\task\wrapper.

Details

at line 41
public __construct(array|Traversable $tasks, string $phpbb_root_path, string $php_ext)

Constructor.

Loads all available tasks.

Parameters

array|Traversable $tasks Provides an iterable set of task names
string $phpbb_root_path Relative path to phpBB root
string $php_ext PHP file extension

at line 57
public null load_tasks(array|Traversable $tasks)

Loads tasks given by name, wraps them and puts them into $this->tasks.

Parameters

array|Traversable $tasks Array of instances of \phpbb\cron\task\task

Return Value

null

at line 74
public wrapper|null find_one_ready_task()

Finds a task that is ready to run.

If several tasks are ready, any one of them could be returned.

If no tasks are ready, null is returned.

Return Value

wrapper|null

at line 92
public array find_all_ready_tasks()

Finds all tasks that are ready to run.

Return Value

array List of tasks which are ready to run (wrapped in \phpbb\cron\task\wrapper).

at line 115
public wrapper find_task(string $name)

Finds a task by name.

If there is no task with the specified name, null is returned.

Web runner uses this method to resolve names to tasks.

Parameters

string $name Name of the task to look up.

Return Value

wrapper A wrapped task corresponding to the given name, or null.

at line 132
public array get_tasks()

Find all tasks and return them.

Return Value

array List of all tasks.

at line 143
public wrapper wrap_task(task $task)

Wraps a task inside an instance of \phpbb\cron\task\wrapper.

Parameters

task $task The task.

Return Value

wrapper The wrapped task.