diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2012-04-09 14:34:35 +0200 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-04-09 14:34:35 +0200 |
| commit | 3896ee953fbdb45d0485c0b5dcdfca47409a22ed (patch) | |
| tree | 86cee60150ff75d33332a60140230a4aaa780c97 /phpBB/includes/cron/task/wrapper.php | |
| parent | aa0c995ed9cdafa2dfaca23b54d5b4cf6323f794 (diff) | |
| download | forums-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/task/wrapper.php')
| -rw-r--r-- | phpBB/includes/cron/task/wrapper.php | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/phpBB/includes/cron/task/wrapper.php b/phpBB/includes/cron/task/wrapper.php index 66c45189e5..75b7fbdaa3 100644 --- a/phpBB/includes/cron/task/wrapper.php +++ b/phpBB/includes/cron/task/wrapper.php @@ -23,6 +23,8 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_wrapper { + private $task, $phpbb_root_path, $phpEx; + /** * Constructor. * @@ -30,9 +32,11 @@ class phpbb_cron_task_wrapper * * @param phpbb_cron_task $task The cron task to wrap. */ - public function __construct(phpbb_cron_task $task) + public function __construct(phpbb_cron_task $task, $phpbb_root_path, $phpEx) { $this->task = $task; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpEx = $phpEx; } /** @@ -62,16 +66,6 @@ class phpbb_cron_task_wrapper } /** - * Returns the name of wrapped task. It is the same as the wrapped class's class name. - * - * @return string Class name of wrapped task. - */ - public function get_name() - { - return get_class($this->task); - } - - /** * Returns a url through which this task may be invoked via web. * * When system cron is not in use, running a cron task is accomplished @@ -82,8 +76,6 @@ class phpbb_cron_task_wrapper */ public function get_url() { - global $phpbb_root_path, $phpEx; - $name = $this->get_name(); if ($this->is_parametrized()) { @@ -98,7 +90,7 @@ class phpbb_cron_task_wrapper { $extra = ''; } - $url = append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $name . $extra); + $url = append_sid($this->phpbb_root_path . 'cron.' . $this->phpEx, 'cron_type=' . $name . $extra); return $url; } |
