summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-10-08 11:11:09 +0000
committerDries Buytaert <dries@buytaert.net>2008-10-08 11:11:09 +0000
commit3257718a0226e7d2dc6775a1aea0597deefe5342 (patch)
tree0a7e43c5abb85baa0a2ca177d9e83d901e1e8dc3 /update.php
parentadad3556bd6782e237b345af782ff158c536ec0e (diff)
downloadbrdo-3257718a0226e7d2dc6775a1aea0597deefe5342.tar.gz
brdo-3257718a0226e7d2dc6775a1aea0597deefe5342.tar.bz2
- Patch #309821 by sun et al: automatic site maintenance during update.php.
Diffstat (limited to 'update.php')
-rw-r--r--update.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/update.php b/update.php
index 36a214a11..09cd8f2bd 100644
--- a/update.php
+++ b/update.php
@@ -290,10 +290,10 @@ function update_script_selection_form() {
function update_batch() {
global $base_url;
- // During the update, toggle site maintenance so that schema changes
- // don't effect visiting users.
- $site_offline = variable_get('site_offline', FALSE);
- if ($site_offline == FALSE) {
+ // During the update, toggle site maintenance so that schema changes do not
+ // affect visiting users.
+ $_SESSION['site_offline'] = variable_get('site_offline', FALSE);
+ if ($_SESSION['site_offline'] == FALSE) {
variable_set('site_offline', TRUE);
}
@@ -320,12 +320,6 @@ function update_batch() {
);
batch_set($batch);
batch_process($base_url . '/update.php?op=results', $base_url . '/update.php');
-
- // Now that the update is done, we can disable site maintenance if
- // it was previously turned off.
- if ($site_offline == FALSE) {
- variable_set('site_offline', FALSE);
- }
}
function update_finished($success, $results, $operations) {
@@ -335,6 +329,13 @@ function update_finished($success, $results, $operations) {
$_SESSION['update_results'] = $results;
$_SESSION['update_success'] = $success;
$_SESSION['updates_remaining'] = $operations;
+
+ // Now that the update is done, we can disable site maintenance if it was
+ // previously turned off.
+ if (isset($_SESSION['site_offline']) && $_SESSION['site_offline'] == FALSE) {
+ variable_set('site_offline', FALSE);
+ unset($_SESSION['site_offline']);
+ }
}
function update_helpful_links() {