From 0dc6029bfed10fac1a09a4fd8de7d1b31407693a Mon Sep 17 00:00:00 2001 From: CHItA Date: Thu, 4 Jun 2015 00:43:08 +0200 Subject: [ticket/13740] Tasks can appear as multiple steps for the progress bar PHPBB3-13740 --- phpBB/install/module_base.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'phpBB/install/module_base.php') diff --git a/phpBB/install/module_base.php b/phpBB/install/module_base.php index 3629903747..179884c039 100644 --- a/phpBB/install/module_base.php +++ b/phpBB/install/module_base.php @@ -173,8 +173,28 @@ abstract class module_base implements module_interface /** * {@inheritdoc} */ - public function get_task_count() + public function get_step_count() { - return sizeof($this->task_collection); + $step_count = 0; + + foreach ($this->task_collection as $task_service_name) + { + $task_service_name_parts = explode('.', $task_service_name); + + if ($task_service_name_parts[0] !== 'installer') + { + // @todo throw an exception + } + + $class_name = '\\phpbb\\install\\module\\' . $task_service_name_parts[1] . '\\task\\' . $task_service_name_parts[2]; + if (!class_exists($class_name)) + { + // @todo throw an exception + } + + $step_count += $class_name::get_step_count(); + } + + return $step_count; } } -- cgit v1.2.1