1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +02:00

[ticket/13740] Tasks can appear as multiple steps for the progress bar

PHPBB3-13740
This commit is contained in:
CHItA
2015-06-04 00:43:08 +02:00
committed by Mate Bartus
parent 63c3500dac
commit 0dc6029bfe
27 changed files with 190 additions and 21 deletions

View File

@@ -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;
}
}