From 3896ee953fbdb45d0485c0b5dcdfca47409a22ed Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Mon, 9 Apr 2012 14:34:35 +0200 Subject: [feature/dic] Give all cron tasks a name, change some manager usage PHPBB3-10739 --- phpBB/includes/cron/task/wrapper.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'phpBB/includes/cron/task/wrapper.php') 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; } /** @@ -61,16 +65,6 @@ class phpbb_cron_task_wrapper return $this->task->is_runnable() && $this->task->should_run(); } - /** - * 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. * @@ -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; } -- cgit v1.2.1 From 5cdcaaa5318c05a04c544eeb25ced571737c2ce3 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 26 Jul 2012 16:15:56 +0200 Subject: [feature/dic] Rename {phpEx => php_ext} for consistency PHPBB3-10739 --- phpBB/includes/cron/task/wrapper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/cron/task/wrapper.php') diff --git a/phpBB/includes/cron/task/wrapper.php b/phpBB/includes/cron/task/wrapper.php index 75b7fbdaa3..d1ddf20156 100644 --- a/phpBB/includes/cron/task/wrapper.php +++ b/phpBB/includes/cron/task/wrapper.php @@ -23,7 +23,7 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_wrapper { - private $task, $phpbb_root_path, $phpEx; + private $task, $phpbb_root_path, $php_ext; /** * Constructor. @@ -32,11 +32,11 @@ class phpbb_cron_task_wrapper * * @param phpbb_cron_task $task The cron task to wrap. */ - public function __construct(phpbb_cron_task $task, $phpbb_root_path, $phpEx) + public function __construct(phpbb_cron_task $task, $phpbb_root_path, $php_ext) { $this->task = $task; $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; } /** @@ -90,7 +90,7 @@ class phpbb_cron_task_wrapper { $extra = ''; } - $url = append_sid($this->phpbb_root_path . 'cron.' . $this->phpEx, 'cron_type=' . $name . $extra); + $url = append_sid($this->phpbb_root_path . 'cron.' . $this->php_ext, 'cron_type=' . $name . $extra); return $url; } -- cgit v1.2.1 From 4f0f63ae8feb8efc70954e64bdca1f81ae98b212 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 25 Aug 2012 16:51:19 +0200 Subject: [feature/dic] Make cron task attributes protected, one per line PHPBB3-10739 --- phpBB/includes/cron/task/wrapper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/cron/task/wrapper.php') diff --git a/phpBB/includes/cron/task/wrapper.php b/phpBB/includes/cron/task/wrapper.php index d1ddf20156..386fb5b383 100644 --- a/phpBB/includes/cron/task/wrapper.php +++ b/phpBB/includes/cron/task/wrapper.php @@ -23,7 +23,9 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_wrapper { - private $task, $phpbb_root_path, $php_ext; + protected $task; + protected $phpbb_root_path; + protected $php_ext; /** * Constructor. -- cgit v1.2.1