diff options
Diffstat (limited to 'phpBB/phpbb/install/module')
-rw-r--r-- | phpBB/phpbb/install/module/requirements/task/check_server_environment.php | 19 | ||||
-rw-r--r-- | phpBB/phpbb/install/module/update_database/task/update.php | 31 |
2 files changed, 47 insertions, 3 deletions
diff --git a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php index 62485a2097..29f9777747 100644 --- a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php +++ b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php @@ -71,6 +71,9 @@ class check_server_environment extends \phpbb\install\task_base // Check for JSON support $this->check_json(); + // XML extension support check + $this->check_xml(); + // Check for dbms support $this->check_available_dbms(); @@ -155,6 +158,22 @@ class check_server_environment extends \phpbb\install\task_base } /** + * Checks whether or not the XML PHP extension is available (Required by the text formatter) + */ + protected function check_xml() + { + if (class_exists('DOMDocument')) + { + $this->set_test_passed(true); + return; + } + + $this->response_helper->add_error_message('PHP_XML_SUPPORT', 'PHP_XML_SUPPORT_EXPLAIN'); + + $this->set_test_passed(false); + } + + /** * Check if any supported DBMS is available */ protected function check_available_dbms() diff --git a/phpBB/phpbb/install/module/update_database/task/update.php b/phpBB/phpbb/install/module/update_database/task/update.php index 9fed2317e9..9d7ba2f919 100644 --- a/phpBB/phpbb/install/module/update_database/task/update.php +++ b/phpBB/phpbb/install/module/update_database/task/update.php @@ -140,10 +140,18 @@ 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()) { @@ -151,6 +159,22 @@ class update extends task_base { $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']) + { + // 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'])) + { + // 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) @@ -165,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(); } } |