From 85e8d1c2efd5f3746ebd50c91ba9e95a98ecb28c Mon Sep 17 00:00:00 2001 From: Etienne Baroux Date: Mon, 2 Jun 2014 16:12:47 +0200 Subject: [ticket/12602] Add function get_tasks. PHPBB3-12602 --- phpBB/phpbb/cron/manager.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'phpBB/phpbb/cron/manager.php') diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php index 1eb8edf033..77dfcff471 100644 --- a/phpBB/phpbb/cron/manager.php +++ b/phpBB/phpbb/cron/manager.php @@ -121,6 +121,21 @@ class manager return null; } + /** + * Find all tasks and return them. + * + * @return array List of all tasks. + */ + public function get_tasks() + { + $tasks = array(); + foreach ($this->tasks as $task) + { + $tasks[] = $task; + } + return $tasks; + } + /** * Wraps a task inside an instance of \phpbb\cron\task\wrapper. * -- cgit v1.2.1 From 760aa9d402aa300349b18ba785fa7ccc4b5fccf5 Mon Sep 17 00:00:00 2001 From: Etienne Baroux Date: Tue, 3 Jun 2014 10:42:50 +0200 Subject: [ticket/12602] Changes to respect coding style and to factorize code. PHPBB3-12602 --- phpBB/phpbb/cron/manager.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'phpBB/phpbb/cron/manager.php') diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php index 77dfcff471..f04f063228 100644 --- a/phpBB/phpbb/cron/manager.php +++ b/phpBB/phpbb/cron/manager.php @@ -128,12 +128,7 @@ class manager */ public function get_tasks() { - $tasks = array(); - foreach ($this->tasks as $task) - { - $tasks[] = $task; - } - return $tasks; + return $this->tasks; } /** -- cgit v1.2.1