diff options
author | Nathan <nathaniel.guse@gmail.com> | 2013-10-02 14:27:46 -0500 |
---|---|---|
committer | Nathan <nathaniel.guse@gmail.com> | 2013-10-02 14:27:46 -0500 |
commit | 621e6c93ed5517cedbf7a6a37c35786a1e2f27e8 (patch) | |
tree | 58fbec041af7239c6799aa3ba5694515af22525c /phpBB | |
parent | 49ce2c13b26e358b4ccef440094a8fa4b6b9afd7 (diff) | |
download | forums-621e6c93ed5517cedbf7a6a37c35786a1e2f27e8.tar forums-621e6c93ed5517cedbf7a6a37c35786a1e2f27e8.tar.gz forums-621e6c93ed5517cedbf7a6a37c35786a1e2f27e8.tar.bz2 forums-621e6c93ed5517cedbf7a6a37c35786a1e2f27e8.tar.xz forums-621e6c93ed5517cedbf7a6a37c35786a1e2f27e8.zip |
[ticket/11883] Report completed data step in migration as "Installing Data"
PHPBB3-11883
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/install/database_update.php | 16 | ||||
-rw-r--r-- | phpBB/language/en/migrator.php | 5 | ||||
-rw-r--r-- | phpBB/phpbb/db/migrator.php | 5 |
3 files changed, 20 insertions, 6 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fa8ec6b6ce..d846884399 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -207,6 +207,8 @@ $safe_time_limit = (ini_get('max_execution_time') / 2); while (!$migrator->finished()) { + $migration_start_time = microtime(true); + try { $migrator->update(); @@ -227,20 +229,26 @@ while (!$migrator->finished()) if (isset($migrator->last_run_migration['effectively_installed']) && $migrator->last_run_migration['effectively_installed']) { - echo $user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $migrator->last_run_migration['name']) . '<br />'; + echo $user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $migrator->last_run_migration['name']); } else { - if ($state['migration_data_done']) + if ($migrator->last_run_migration['task'] == 'process_data_step' && $state['migration_data_done']) + { + echo $user->lang('MIGRATION_DATA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time), (time() - $update_start_time)); + } + else if ($migrator->last_run_migration['task'] == 'process_data_step') { - echo $user->lang('MIGRATION_DATA_DONE', $migrator->last_run_migration['name']) . '<br />'; + echo $user->lang('MIGRATION_DATA_IN_PROGRESS', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time), (time() - $update_start_time)); } else if ($state['migration_schema_done']) { - echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name']) . '<br />'; + echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time), (time() - $update_start_time)); } } + echo "<br />\n"; + // Are we approaching the time limit? If so we want to pause the update and continue after refreshing if ((time() - $update_start_time) >= $safe_time_limit) { diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php index 34dcbf4c52..1d8886d12b 100644 --- a/phpBB/language/en/migrator.php +++ b/phpBB/language/en/migrator.php @@ -39,11 +39,12 @@ $lang = array_merge($lang, array( 'GROUP_NOT_EXIST' => 'The group "%s" unexpectedly does not exist.', - 'MIGRATION_DATA_DONE' => 'Installed Data: %s', + 'MIGRATION_DATA_DONE' => 'Installed Data: %1$s; Time: %2$.2f seconds', + 'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds', 'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s', 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.', 'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".', - 'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %s', + 'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds', 'MODULE_ERROR' => 'An error occurred while creating a module: %s', 'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s', diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 7efb23a230..acfd943e56 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -204,6 +204,7 @@ class migrator 'name' => $name, 'class' => $migration, 'state' => $state, + 'task' => '', ); if (!isset($this->migration_state[$name])) @@ -231,6 +232,7 @@ class migrator if (!$state['migration_schema_done']) { + $this->last_run_migration['task'] = 'apply_schema_changes'; $this->apply_schema_changes($migration->update_schema()); $state['migration_schema_done'] = true; } @@ -238,6 +240,7 @@ class migrator { try { + $this->last_run_migration['task'] = 'process_data_step'; $result = $this->process_data_step($migration->update_data(), $state['migration_data_state']); $state['migration_data_state'] = ($result === true) ? '' : $result; @@ -308,6 +311,7 @@ class migrator $this->last_run_migration = array( 'name' => $name, 'class' => $migration, + 'task' => '', ); if ($state['migration_data_done']) @@ -626,6 +630,7 @@ class migrator { continue; } + return false; } |