зеркало из https://github.com/nextcloud/server.git
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:
Родитель
4f6565d8e7
Коммит
41f7eb948a
|
@ -5,6 +5,8 @@ require_once '../../lib/base.php';
|
||||||
|
|
||||||
if (OC::checkUpgrade(false)) {
|
if (OC::checkUpgrade(false)) {
|
||||||
\OC_DB::enableCaching(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();
|
$updateEventSource = new OC_EventSource();
|
||||||
$watcher = new UpdateWatcher($updateEventSource);
|
$watcher = new UpdateWatcher($updateEventSource);
|
||||||
OC_Hook::connect('update', 'success', $watcher, 'success');
|
OC_Hook::connect('update', 'success', $watcher, 'success');
|
||||||
|
@ -99,6 +101,7 @@ class UpdateWatcher {
|
||||||
OC_Util::obEnd();
|
OC_Util::obEnd();
|
||||||
$this->eventSource->send('failure', $message);
|
$this->eventSource->send('failure', $message);
|
||||||
$this->eventSource->close();
|
$this->eventSource->close();
|
||||||
|
OC_Config::setValue('maintenance', false);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,10 +282,6 @@ class OC {
|
||||||
$currentVersion = implode('.', OC_Util::getVersion());
|
$currentVersion = implode('.', OC_Util::getVersion());
|
||||||
if (version_compare($currentVersion, $installedVersion, '>')) {
|
if (version_compare($currentVersion, $installedVersion, '>')) {
|
||||||
if ($showTemplate && !OC_Config::getValue('maintenance', false)) {
|
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 = new OC_Minimizer_CSS();
|
||||||
$minimizerCSS->clearCache();
|
$minimizerCSS->clearCache();
|
||||||
$minimizerJS = new OC_Minimizer_JS();
|
$minimizerJS = new OC_Minimizer_JS();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче