diff options
| author | CHItA <mate.bartus@gmail.com> | 2015-06-04 00:43:08 +0200 |
|---|---|---|
| committer | Mate Bartus <mate.bartus@gmail.com> | 2015-07-08 01:28:01 +0200 |
| commit | 0dc6029bfed10fac1a09a4fd8de7d1b31407693a (patch) | |
| tree | 5a127646e3f48b4328cb9091c207c965b0c01034 /phpBB/install/module_base.php | |
| parent | 63c3500dacc8d272e85273a67f56faa51a9d5fba (diff) | |
| download | forums-0dc6029bfed10fac1a09a4fd8de7d1b31407693a.tar forums-0dc6029bfed10fac1a09a4fd8de7d1b31407693a.tar.gz forums-0dc6029bfed10fac1a09a4fd8de7d1b31407693a.tar.bz2 forums-0dc6029bfed10fac1a09a4fd8de7d1b31407693a.tar.xz forums-0dc6029bfed10fac1a09a4fd8de7d1b31407693a.zip | |
[ticket/13740] Tasks can appear as multiple steps for the progress bar
PHPBB3-13740
Diffstat (limited to 'phpBB/install/module_base.php')
| -rw-r--r-- | phpBB/install/module_base.php | 24 |
1 files changed, 22 insertions, 2 deletions
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; } } |
