Move start of the maintenance mode to the ajax call

Make sure the update page is shown in a browser. And not an ajax request
This commit is contained in:
Bart Visscher 2013-04-09 20:51:43 +02:00
parent 4f6565d8e7
commit 41f7eb948a
2 changed files with 3 additions and 4 deletions

View File

@ -5,6 +5,8 @@ require_once '../../lib/base.php';
if (OC::checkUpgrade(false)) {
\OC_DB::enableCaching(false);
OC_Config::setValue('maintenance', true);
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');
@ -99,6 +101,7 @@ class UpdateWatcher {
OC_Util::obEnd();
$this->eventSource->send('failure', $message);
$this->eventSource->close();
OC_Config::setValue('maintenance', false);
die();
}

View File

@ -282,10 +282,6 @@ class OC {
$currentVersion = implode('.', OC_Util::getVersion());
if (version_compare($currentVersion, $installedVersion, '>')) {
if ($showTemplate && !OC_Config::getValue('maintenance', false)) {
OC_Config::setValue('maintenance', true);
OC_Log::write('core',
'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion,
OC_Log::WARN);
$minimizerCSS = new OC_Minimizer_CSS();
$minimizerCSS->clearCache();
$minimizerJS = new OC_Minimizer_JS();