aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cron/manager.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-04-09 14:34:35 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-04-09 14:34:35 +0200
commit3896ee953fbdb45d0485c0b5dcdfca47409a22ed (patch)
tree86cee60150ff75d33332a60140230a4aaa780c97 /phpBB/includes/cron/manager.php
parentaa0c995ed9cdafa2dfaca23b54d5b4cf6323f794 (diff)
downloadforums-3896ee953fbdb45d0485c0b5dcdfca47409a22ed.tar
forums-3896ee953fbdb45d0485c0b5dcdfca47409a22ed.tar.gz
forums-3896ee953fbdb45d0485c0b5dcdfca47409a22ed.tar.bz2
forums-3896ee953fbdb45d0485c0b5dcdfca47409a22ed.tar.xz
forums-3896ee953fbdb45d0485c0b5dcdfca47409a22ed.zip
[feature/dic] Give all cron tasks a name, change some manager usage
PHPBB3-10739
Diffstat (limited to 'phpBB/includes/cron/manager.php')
-rw-r--r--phpBB/includes/cron/manager.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/includes/cron/manager.php b/phpBB/includes/cron/manager.php
index 5abbc987dd..5ea909eb2c 100644
--- a/phpBB/includes/cron/manager.php
+++ b/phpBB/includes/cron/manager.php
@@ -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);
+ }
}