diff options
Diffstat (limited to 'lib/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index 59b1c0a8f66..3299bc1de83 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -163,14 +163,18 @@ class Updater extends BasicEmitter { * @return bool true if the operation succeeded, false otherwise */ public function upgrade() { - $this->config->setSystemValue('maintenance', true); + $wasMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); + + if(!$wasMaintenanceModeEnabled) { + $this->config->setSystemValue('maintenance', true); + $this->emit('\OC\Updater', 'maintenanceEnabled'); + } $installedVersion = $this->config->getSystemValue('version', '0.0.0'); $currentVersion = implode('.', \OC_Util::getVersion()); if ($this->log) { $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); } - $this->emit('\OC\Updater', 'maintenanceStart'); try { $this->doUpgrade($currentVersion, $installedVersion); @@ -178,8 +182,14 @@ class Updater extends BasicEmitter { $this->emit('\OC\Updater', 'failure', array($exception->getMessage())); } - $this->config->setSystemValue('maintenance', false); - $this->emit('\OC\Updater', 'maintenanceEnd'); + $this->emit('\OC\Updater', 'updateEnd'); + + if(!$wasMaintenanceModeEnabled) { + $this->config->setSystemValue('maintenance', false); + $this->emit('\OC\Updater', 'maintenanceDisabled'); + } else { + $this->emit('\OC\Updater', 'maintenanceActive'); + } } /** |