diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-08-21 09:44:37 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-08-21 09:44:37 +0200 |
commit | 76748183bb46d111d7cc36f683385ecae70721e7 (patch) | |
tree | b8aade382cdf3718ecff6450089d8f2e9fdc3d9e /phpBB/phpbb/install | |
parent | 723d9d8e4c9f397eab7af77e6e6bd851354a9dcd (diff) | |
parent | a37f10ae0951f16b115f4a175cc546a515cf7937 (diff) | |
download | forums-76748183bb46d111d7cc36f683385ecae70721e7.tar forums-76748183bb46d111d7cc36f683385ecae70721e7.tar.gz forums-76748183bb46d111d7cc36f683385ecae70721e7.tar.bz2 forums-76748183bb46d111d7cc36f683385ecae70721e7.tar.xz forums-76748183bb46d111d7cc36f683385ecae70721e7.zip |
Merge pull request #4420 from Elsensee/ticket/14742-32x
[ticket/14742-32x] Further improvements to migrator
Diffstat (limited to 'phpBB/phpbb/install')
-rw-r--r-- | phpBB/phpbb/install/helper/iohandler/cli_iohandler.php | 11 | ||||
-rw-r--r-- | phpBB/phpbb/install/module/update_database/task/update.php | 14 |
2 files changed, 20 insertions, 5 deletions
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(); } } |