From 064f5204cc365bcf8c12ef34e6fde92175c9d6fa Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 19 May 2015 10:27:53 +0200 Subject: Persist the state of the maintenance after an upgrade * if maintenance mode was enabled before an upgrade it will be enabled afterwards too * fixes #16429 --- core/command/upgrade.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'core/command/upgrade.php') diff --git a/core/command/upgrade.php b/core/command/upgrade.php index 7f5d943bb8b..786e2e28ed2 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -107,12 +107,17 @@ class Upgrade extends Command { $updater->setSimulateStepEnabled($simulateStepEnabled); $updater->setUpdateStepEnabled($updateStepEnabled); - $updater->listen('\OC\Updater', 'maintenanceStart', function () use($output) { + $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) { $output->writeln('Turned on maintenance mode'); }); - $updater->listen('\OC\Updater', 'maintenanceEnd', + $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use($output) { + $output->writeln('Turned off maintenance mode'); + }); + $updater->listen('\OC\Updater', 'maintenanceActive', function () use($output) { + $output->writeln('Maintenance mode is kept active'); + }); + $updater->listen('\OC\Updater', 'updateEnd', function () use($output, $updateStepEnabled, $self) { - $output->writeln('Turned off maintenance mode'); $mode = $updateStepEnabled ? 'Update' : 'Update simulation'; $status = $self->upgradeFailed ? 'failed' : 'successful'; $message = "$mode $status"; -- cgit v1.2.3