aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cron/task/provider.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/cron/task/provider.php')
-rw-r--r--phpBB/includes/cron/task/provider.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/phpBB/includes/cron/task/provider.php b/phpBB/includes/cron/task/provider.php
index 134723ebd1..08e54a651a 100644
--- a/phpBB/includes/cron/task/provider.php
+++ b/phpBB/includes/cron/task/provider.php
@@ -26,10 +26,11 @@ use Symfony\Component\DependencyInjection\TaggedContainerInterface;
*/
class phpbb_cron_task_provider implements IteratorAggregate
{
- private $container;
+ private $tasks;
- public function __construct(TaggedContainerInterface $container)
+ public function __construct(phpbb_cron_task_collection $tasks, TaggedContainerInterface $container)
{
+ $this->tasks = $tasks;
$this->container = $container;
}
@@ -40,18 +41,24 @@ class phpbb_cron_task_provider implements IteratorAggregate
*/
public function getIterator()
{
- $definitions = $this->container->findTaggedServiceIds('cron.task');
-
$tasks = array();
- foreach ($definitions as $name => $definition)
+ foreach ($this->tasks as $names)
{
- $task = $this->container->get($name);
- if ($task instanceof phpbb_cron_task_base)
+ foreach ($names as $name)
{
- $task->set_name($name);
- }
+ if (!$this->container->has($name))
+ {
+ continue;
+ }
- $tasks[] = $task;
+ $task = $this->container->get($name);
+ if ($task instanceof phpbb_cron_task_base)
+ {
+ $task->set_name($name);
+ }
+
+ $tasks[] = $task;
+ }
}
return new ArrayIterator($tasks);