diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-08-13 23:13:07 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-08-13 23:13:07 +0200 |
commit | 4466ef1bc4b66a4396054aa5e3c4eec9c97f231b (patch) | |
tree | dce8ad8a5dc05069ee1df7b5c08987129361d18e /phpBB/phpbb/install | |
parent | 55f98d0941e17b473015baf07026efabaf676916 (diff) | |
parent | 758fe20f4be7178fd4b9fd6ce48c5342cfcbce27 (diff) | |
download | forums-4466ef1bc4b66a4396054aa5e3c4eec9c97f231b.tar forums-4466ef1bc4b66a4396054aa5e3c4eec9c97f231b.tar.gz forums-4466ef1bc4b66a4396054aa5e3c4eec9c97f231b.tar.bz2 forums-4466ef1bc4b66a4396054aa5e3c4eec9c97f231b.tar.xz forums-4466ef1bc4b66a4396054aa5e3c4eec9c97f231b.zip |
Merge pull request #4410 from Elsensee/ticket/14742-32x
[ticket/14742-32x] Improvements to migrator
Diffstat (limited to 'phpBB/phpbb/install')
-rw-r--r-- | phpBB/phpbb/install/module/update_database/task/update.php | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/phpBB/phpbb/install/module/update_database/task/update.php b/phpBB/phpbb/install/module/update_database/task/update.php index 9fed2317e9..c69dafaa10 100644 --- a/phpBB/phpbb/install/module/update_database/task/update.php +++ b/phpBB/phpbb/install/module/update_database/task/update.php @@ -140,17 +140,36 @@ class update extends task_base ->get_classes(); $this->migrator->set_migrations($migrations); - $migration_count = count($this->migrator->get_migrations()); - $this->iohandler->set_task_count($migration_count, true); - $this->installer_config->set_task_progress_count($migration_count); + + $migration_step_count = $this->installer_config->get('database_update_migration_steps', -1); + if ($migration_step_count < 0) + { + $migration_step_count = count($this->migrator->get_installable_migrations()) * 2; + $this->installer_config->set('database_update_migration_steps', $migration_step_count); + } + $progress_count = $this->installer_config->get('database_update_count', 0); + $restart_progress_bar = ($progress_count === 0); // Only "restart" when the update runs for the first time + $this->iohandler->set_task_count($migration_step_count, $restart_progress_bar); + $this->installer_config->set_task_progress_count($migration_step_count); while (!$this->migrator->finished()) { 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; + } + 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++; + } + $this->iohandler->set_progress('STAGE_UPDATE_DATABASE', $progress_count); } catch (exception $e) |