From a37f10ae0951f16b115f4a175cc546a515cf7937 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sat, 20 Aug 2016 22:40:37 +0200 Subject: [ticket/14742] Increase user feedback by improving progress bar We now count and display each step that was done by increasing the task count. PHPBB3-14742 --- phpBB/phpbb/install/helper/iohandler/cli_iohandler.php | 11 ++++++++++- phpBB/phpbb/install/module/update_database/task/update.php | 14 ++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'phpBB') diff --git a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php index 2a41cb10ba..196cdcdaab 100644 --- a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php +++ b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php @@ -198,6 +198,16 @@ class cli_iohandler extends iohandler_base if ($this->output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL) { + if ($this->progress_bar !== null) + { + // Symfony's ProgressBar is immutable regarding task_count, so delete the old and create a new one. + $this->progress_bar->clear(); + } + else + { + $this->io->newLine(2); + } + $this->progress_bar = $this->io->createProgressBar($task_count); $this->progress_bar->setFormat( " %current:3s%/%max:-3s% %bar% %percent:3s%%\n" . @@ -212,7 +222,6 @@ class cli_iohandler extends iohandler_base } $this->progress_bar->setMessage(''); - $this->io->newLine(2); $this->progress_bar->start(); } } diff --git a/phpBB/phpbb/install/module/update_database/task/update.php b/phpBB/phpbb/install/module/update_database/task/update.php index c69dafaa10..9d7ba2f919 100644 --- a/phpBB/phpbb/install/module/update_database/task/update.php +++ b/phpBB/phpbb/install/module/update_database/task/update.php @@ -158,18 +158,23 @@ class update extends task_base try { $this->migrator->update(); + $progress_count++; $last_run_migration = $this->migrator->get_last_run_migration(); if (isset($last_run_migration['effectively_installed']) && $last_run_migration['effectively_installed']) { - $progress_count += 2; + // We skipped two step, so increment $progress_count by another one + $progress_count++; } - else if (($last_run_migration['task'] === 'process_schema_step' && $last_run_migration['state']['migration_schema_done']) || - ($last_run_migration['task'] === 'process_data_step' && $last_run_migration['state']['migration_data_done'])) + else if (($last_run_migration['task'] === 'process_schema_step' && !$last_run_migration['state']['migration_schema_done']) || + ($last_run_migration['task'] === 'process_data_step' && !$last_run_migration['state']['migration_data_done'])) { - $progress_count++; + // We just run a step that wasn't counted yet so make it count + $migration_step_count++; } + $this->iohandler->set_task_count($migration_step_count); + $this->installer_config->set_task_progress_count($migration_step_count); $this->iohandler->set_progress('STAGE_UPDATE_DATABASE', $progress_count); } catch (exception $e) @@ -184,6 +189,7 @@ class update extends task_base if ($this->installer_config->get_time_remaining() <= 0 || $this->installer_config->get_memory_remaining() <= 0) { $this->installer_config->set('database_update_count', $progress_count); + $this->installer_config->set('database_update_migration_steps', $migration_step_count); throw new resource_limit_reached_exception(); } } -- cgit v1.2.1 /unlabeled-1.1.1'>topic/unlabeled-1.1.1 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* translate server {name} at display-time, not compile-timePascal Rigaux2003-02-171-5/+5
* replace %level_list with level_list() so that N("...") is called at runtimePascal Rigaux2003-02-171-13/+13
* change %countries so that we really have translated countries (side effect of...Guillaume Cottenceau2003-02-171-239/+239
* fix translation of title by calling N() after interactive->vnewGuillaume Cottenceau2003-02-171-1/+1
* fix translation of title: N() needs to be called afterGuillaume Cottenceau2003-02-171-1/+1
* updated Estonian filePablo Saratxaga2003-02-177-10/+10
* fix typos (thanks to Reinout van Schouwen)Pascal Rigaux2003-02-171-2/+2
* remove debug code :-(Pascal Rigaux2003-02-171-1/+1
* grĂ¼hGuillaume Cottenceau2003-02-171-1/+1
* updated pot filePablo Saratxaga2003-02-173-270/+478
* disable mn until we have lang-mn.pngGuillaume Cottenceau2003-02-171-1/+1
* fix pixel's commit: never display choosePackages andGuillaume Cottenceau2003-02-171-2/+2
* replace ext2resize with resize2fs in rescue (already done in DrakX)Pascal Rigaux2003-02-173-3/+3
* don't show "Choose packages to install" nor "Configure services"Pascal Rigaux2003-02-171-2/+2
* updated @locales listPablo Saratxaga2003-02-171-2/+4
* given default size of / increased.Francois Pons2003-02-171-2/+2
* increased /var container for suggestion (simple or with /usr).Francois Pons2003-02-171-2/+2
* add a reboot if not enough free space is available for installation or upgrade.Francois Pons2003-02-171-1/+5
* fixed command insmod.Francois Pons2003-02-171-1/+2
* bump version numberThierry Vignaud2003-02-171-1/+1
* synced with msecThierry Vignaud2003-02-171-1/+1
* *** empty log message ***Pascal Rigaux2003-02-171-1/+39
* add a checkbox "Force ACPI"Pascal Rigaux2003-02-171-0/+9
* propagate /proc/cmdline acpi=xxxPascal Rigaux2003-02-171-1/+3
* have acpi=off by defaultPascal Rigaux2003-02-171-1/+1
* have acpi=off by defaultPascal Rigaux2003-02-171-0/+1
* fix pop_it...Pascal Rigaux2003-02-171-1/+1
* ensure $o->{raw_X} is not destroyed when there is no modification donePascal Rigaux2003-02-171-1/+2
* 9.1-0.34mdkTill Kamppeter2003-02-171-2/+5
* *** empty log message ***Pascal Rigaux2003-02-171-1/+123
* hopefully final fix for pop_itPascal Rigaux2003-02-171-2/+2
* - Fixed bug of HP DeskJetb 990C being automatically installed even ifTill Kamppeter2003-02-171-11/+21
* (is_fbdev): fix typoPascal Rigaux2003-02-171-1/+1
* (get_both): fix typoPascal Rigaux2003-02-171-1/+1
* also ->hide in when a button is clicked in standalonePascal Rigaux2003-02-171-10/+2
* don't security::various::config_security_user() can fail, don't let it bother usPascal Rigaux2003-02-171-1/+1
* (to_string): simpler way to handle the "default" resolution of frame-bufferPascal Rigaux2003-02-171-1/+1
* 9.1 rc1Florent Villard2003-02-171-0/+0
* use fbdev when the graphic card is unknownPascal Rigaux2003-02-171-5/+9
* warn when auto conf failPascal Rigaux2003-02-171-1/+4
* add module2description()Pascal Rigaux2003-02-171-3/+9
* correction for non-latin1 locales,Pablo Saratxaga2003-02-171-2/+6
* in the old days, on cannot disable shrink1, resize2 or shrink2 since they alw...Thierry Vignaud2003-02-171-2/+5
* better sound card description in summaryPascal Rigaux2003-02-171-1/+3
* enhance summary layoutPascal Rigaux2003-02-171-2/+4
* fix help popping all the timePascal Rigaux2003-02-171-1/+1
* 9.1-0.33mdkThierry Vignaud2003-02-171-1/+8
* fix setting pop_it for wizard in standalonePascal Rigaux2003-02-171-1/+2
* updated Russian and Arabic filesPablo Saratxaga2003-02-172-20216/+32221
* simplify translator job by propaging pixel english typo fixThierry Vignaud2003-02-17