From 621e6c93ed5517cedbf7a6a37c35786a1e2f27e8 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 2 Oct 2013 14:27:46 -0500 Subject: [ticket/11883] Report completed data step in migration as "Installing Data" PHPBB3-11883 --- phpBB/install/database_update.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'phpBB/install/database_update.php') 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']) . '
'; + 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']) . '
'; + 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']) . '
'; + echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time), (time() - $update_start_time)); } } + echo "
\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) { -- cgit v1.2.1 From 3259bd1196ca2a7f77fe7060e5510813e7844ebd Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 4 Oct 2013 09:23:54 -0500 Subject: [ticket/11883] Only output the migration time, not total PHPBB3-11883 --- phpBB/install/database_update.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d846884399..b79420ab71 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -235,15 +235,15 @@ while (!$migrator->finished()) { 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)); + echo $user->lang('MIGRATION_DATA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time)); } else if ($migrator->last_run_migration['task'] == 'process_data_step') { - echo $user->lang('MIGRATION_DATA_IN_PROGRESS', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time), (time() - $update_start_time)); + echo $user->lang('MIGRATION_DATA_IN_PROGRESS', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time)); } else if ($state['migration_schema_done']) { - echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time), (time() - $update_start_time)); + echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time)); } } -- cgit v1.2.1