Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
3257718a
Commit
3257718a
authored
16 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#309821
by sun et al: automatic site maintenance during update.php.
parent
adad3556
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
update.php
+11
-10
11 additions, 10 deletions
update.php
with
11 additions
and
10 deletions
update.php
+
11
−
10
View file @
3257718a
...
...
@@ -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 e
ffect 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
//
a
ffect 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
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment