Line 58 | Line 58 |
---|
* @var string */ protected $php_ext;
|
* @var string */ protected $php_ext;
|
| /** * @var \phpbb\template\template */ protected $template;
|
/** * Constructor. Loads all available tasks.
| /** * Constructor. Loads all available tasks.
|
Line 66 | Line 71 |
---|
* @param helper $routing_helper Routing helper * @param string $phpbb_root_path Relative path to phpBB root * @param string $php_ext PHP file extension
|
* @param helper $routing_helper Routing helper * @param string $phpbb_root_path Relative path to phpBB root * @param string $php_ext PHP file extension
|
| * @param \phpbb\template\template $template
|
*/
|
*/
|
public function __construct(ContainerInterface $phpbb_container, helper $routing_helper, $phpbb_root_path, $php_ext)
| public function __construct(ContainerInterface $phpbb_container, helper $routing_helper, $phpbb_root_path, $php_ext, $template)
|
{ $this->phpbb_container = $phpbb_container; $this->routing_helper = $routing_helper; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext;
|
{ $this->phpbb_container = $phpbb_container; $this->routing_helper = $routing_helper; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext;
|
| $this->template = $template;
|
}
/**
| }
/**
|
Line 80 | Line 87 |
---|
* and puts them into $this->tasks. * * @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task
|
* and puts them into $this->tasks. * * @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task
|
* * @return null
| |
*/ public function load_tasks($tasks) {
| */ public function load_tasks($tasks) {
|
Line 94 | Line 99 |
---|
/** * Loads registered tasks from the container, wraps them * and puts them into $this->tasks.
|
/** * Loads registered tasks from the container, wraps them * and puts them into $this->tasks.
|
* * @return null
| |
*/ public function load_tasks_from_container() {
| */ public function load_tasks_from_container() {
|
Line 116 | Line 119 |
---|
* * If no tasks are ready, null is returned. *
|
* * If no tasks are ready, null is returned. *
|
* @return \phpbb\cron\task\wrapper|null
| * @return wrapper|null
|
*/ public function find_one_ready_task() {
| */ public function find_one_ready_task() {
|
Line 161 | Line 164 |
---|
* Web runner uses this method to resolve names to tasks. * * @param string $name Name of the task to look up.
|
* Web runner uses this method to resolve names to tasks. * * @param string $name Name of the task to look up.
|
* @return \phpbb\cron\task\wrapper A wrapped task corresponding to the given name, or null.
| * @return wrapper A wrapped task corresponding to the given name, or null.
|
*/ public function find_task($name) {
| */ public function find_task($name) {
|
Line 193 | Line 196 |
---|
* Wraps a task inside an instance of \phpbb\cron\task\wrapper. * * @param \phpbb\cron\task\task $task The task.
|
* Wraps a task inside an instance of \phpbb\cron\task\wrapper. * * @param \phpbb\cron\task\task $task The task.
|
* @return \phpbb\cron\task\wrapper The wrapped task.
| * @return wrapper The wrapped task.
|
*/ public function wrap_task(\phpbb\cron\task\task $task) {
|
*/ public function wrap_task(\phpbb\cron\task\task $task) {
|
return new wrapper($task, $this->routing_helper, $this->phpbb_root_path, $this->php_ext);
| return new wrapper($task, $this->routing_helper, $this->phpbb_root_path, $this->php_ext, $this->template);
|
} }
| } }
|