summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/ajax/update.php5
-rw-r--r--core/command/upgrade.php38
2 files changed, 27 insertions, 16 deletions
diff --git a/core/ajax/update.php b/core/ajax/update.php
index 8ed0fad57e9..631a8a7871c 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -61,6 +61,11 @@ if (OC::checkUpgrade(false)) {
$eventSource->send('success', (string)$l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()]));
}
});
+ $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($eventSource, $l) {
+ if ($event instanceof GenericEvent) {
+ $eventSource->send('success', (string)$l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()]));
+ }
+ });
$updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Turned on maintenance mode'));
diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index c2de699d862..cbb1f26f938 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -139,26 +139,32 @@ class Upgrade extends Command {
$updater->setSkip3rdPartyAppsDisable($skip3rdPartyAppsDisable);
$dispatcher = \OC::$server->getEventDispatcher();
$progress = new ProgressBar($output);
- $progress->setFormat("%message%\n %current%/%max% [%bar%] %percent:3s%%");
- $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($progress, $output) {
+ $progress->setFormat(" %message%\n %current%/%max% [%bar%] %percent:3s%%");
+ $listener = function($event) use ($progress, $output) {
if ($event instanceof GenericEvent) {
- if ($event[0] === 1) {
- $output->writeln('');
- $progress->start($event[1]);
- }
$message = $event->getSubject();
- if (strlen($message) > 30) {
- $message = substr($message, 0, 27) . '...';
- }
- $progress->setMessage($message);
- $progress->setProgress($event[0]);
- $progress->display();
- if ($event[0] === $event[1]) {
- $progress->finish();
- $output->writeln('');
+ if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) {
+ $output->writeln(' Checking table ' . $message);
+ } else {
+ if (strlen($message) > 60) {
+ $message = substr($message, 0, 57) . '...';
+ }
+ $progress->setMessage($message);
+ if ($event[0] === 1) {
+ $output->writeln('');
+ $progress->start($event[1]);
+ }
+ $progress->setProgress($event[0]);
+ if ($event[0] === $event[1]) {
+ $progress->setMessage('Done');
+ $progress->finish();
+ $output->writeln('');
+ }
}
}
- });
+ };
+ $dispatcher->addListener('\OC\DB\Migrator::executeSql', $listener);
+ $dispatcher->addListener('\OC\DB\Migrator::checkTable', $listener);
$updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) {
$output->writeln('<info>Turned on maintenance mode</info>');