diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-06-27 17:51:37 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-06-27 17:54:17 +0200 |
commit | c6bbccc776ee9ea1112d3cfab54c9f2c95540130 (patch) | |
tree | 799c938b8d314a4f49fdeba43f5b42e212f77fcd /core/ajax/update.php | |
parent | 969e43c87b7afb6184846fe27849167c9c6f5eab (diff) | |
parent | 6fcee1ee117a167aa0c526ca39effbf086d10991 (diff) | |
download | nextcloud-server-c6bbccc776ee9ea1112d3cfab54c9f2c95540130.tar.gz nextcloud-server-c6bbccc776ee9ea1112d3cfab54c9f2c95540130.zip |
Merge branch 'master' into convert-oc_config
Conflicts:
lib/config.php
lib/setup.php
Diffstat (limited to 'core/ajax/update.php')
-rw-r--r-- | core/ajax/update.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/ajax/update.php b/core/ajax/update.php index 6015a901eb7..db00da02239 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -5,11 +5,15 @@ require_once '../../lib/base.php'; if (OC::checkUpgrade(false)) { \OC_DB::enableCaching(false); + OC_Config::setValue('maintenance', true); + $installedVersion = OC_Config::getValue('version', '0.0.0'); + $currentVersion = implode('.', OC_Util::getVersion()); + OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, OC_Log::WARN); $updateEventSource = new OC_EventSource(); $watcher = new UpdateWatcher($updateEventSource); OC_Hook::connect('update', 'success', $watcher, 'success'); OC_Hook::connect('update', 'error', $watcher, 'error'); - OC_Hook::connect('update', 'error', $watcher, 'failure'); + OC_Hook::connect('update', 'failure', $watcher, 'failure'); $watcher->success('Turned on maintenance mode'); try { $result = OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml'); @@ -99,6 +103,7 @@ class UpdateWatcher { OC_Util::obEnd(); $this->eventSource->send('failure', $message); $this->eventSource->close(); + OC_Config::setValue('maintenance', false); die(); } @@ -108,4 +113,4 @@ class UpdateWatcher { $this->eventSource->close(); } -} +}
\ No newline at end of file |