From 9a8fccbabcb5df145ac32f3c850998e264781d42 Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Mon, 12 Jun 2023 09:49:34 +1000 Subject: [PATCH] MDL-73734 tool_httpreplace: Use streaming output api --- admin/tool/httpsreplace/classes/url_finder.php | 1 + admin/tool/httpsreplace/tool.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/tool/httpsreplace/classes/url_finder.php b/admin/tool/httpsreplace/classes/url_finder.php index 7ac5bc3cf2b..1f7ab80eb4e 100644 --- a/admin/tool/httpsreplace/classes/url_finder.php +++ b/admin/tool/httpsreplace/classes/url_finder.php @@ -151,6 +151,7 @@ class url_finder { sort($tables); // Make it easier to see progress because they are ordered. $numberoftables = count($tables); $tablenumber = 0; + sort($tables); foreach ($tables as $table) { if ($progress) { $progress->update($tablenumber, $numberoftables, get_string('searching', 'tool_httpsreplace', $table)); diff --git a/admin/tool/httpsreplace/tool.php b/admin/tool/httpsreplace/tool.php index 6d2d96349d7..59d6b54b855 100644 --- a/admin/tool/httpsreplace/tool.php +++ b/admin/tool/httpsreplace/tool.php @@ -58,6 +58,14 @@ $finder = new \tool_httpsreplace\url_finder(); $PAGE->set_cacheable(false); $progressbar = new progress_bar(); +// Preemptively reset the navcache before closing, so it remains the same on shutdown. +navigation_cache::destroy_volatile_caches(); +\core\session\manager::write_close(); + +// Prepare for streamed output. +echo $OUTPUT->footer(); +echo $OUTPUT->select_element_for_append(); + if (!$data = $form->get_data()) { echo $progressbar->create(); @@ -103,4 +111,3 @@ if (!$data = $form->get_data()) { echo $OUTPUT->continue_button(new moodle_url('/admin/settings.php', ['section' => 'httpsecurity'])); } -echo $OUTPUT->footer();