mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[feature/dic] Give all cron tasks a name, change some manager usage
PHPBB3-10739
This commit is contained in:
@@ -32,13 +32,18 @@ class phpbb_cron_manager
|
||||
*/
|
||||
protected $tasks = array();
|
||||
|
||||
protected $phpbb_root_path, $phpEx;
|
||||
|
||||
/**
|
||||
* Constructor. Loads all available tasks.
|
||||
*
|
||||
* @param array|Traversable $tasks Provides an iterable set of task names
|
||||
*/
|
||||
public function __construct($tasks)
|
||||
public function __construct($tasks, $phpbb_root_path, $phpEx)
|
||||
{
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->phpEx = $phpEx;
|
||||
|
||||
$this->load_tasks($tasks);
|
||||
}
|
||||
|
||||
@@ -54,8 +59,7 @@ class phpbb_cron_manager
|
||||
{
|
||||
foreach ($tasks as $task)
|
||||
{
|
||||
$wrapper = new phpbb_cron_task_wrapper($task);
|
||||
$this->tasks[] = $wrapper;
|
||||
$this->tasks[] = $this->wrap_task($task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +123,9 @@ class phpbb_cron_manager
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function wrap_task(phpbb_cron_task $task)
|
||||
{
|
||||
return new phpbb_cron_task_wrapper($task, $this->phpbb_root_path, $this->phpEx);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user