summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-23 10:43:45 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-06-23 13:13:44 +0200
commit1ba9fd3ada07c42b1151de64004702acf22382d1 (patch)
tree162a1b96265dc9b4fddc16c93d07328db0d83a12
parent2654696086988c11c57cc9d72579ce3912aa08c6 (diff)
downloadnextcloud-server-1ba9fd3ada07c42b1151de64004702acf22382d1.tar.gz
nextcloud-server-1ba9fd3ada07c42b1151de64004702acf22382d1.zip
[upgrade] print update message before running the update code
* otherwise you don't know during which app update something failed
-rw-r--r--core/command/upgrade.php3
-rw-r--r--lib/private/updater.php1
2 files changed, 4 insertions, 0 deletions
diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index 2d6394fea85..58e98e2bbdc 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -158,6 +158,9 @@ class Upgrade extends Command {
$updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($output) {
$output->writeln('<info>Checked database schema update for apps</info>');
});
+ $updater->listen('\OC\Updater', 'appUpgradeStarted', function ($app, $version) use ($output) {
+ $output->writeln("<info>Updating <$app> ...</info>");
+ });
$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) {
$output->writeln("<info>Updated <$app> to $version</info>");
});
diff --git a/lib/private/updater.php b/lib/private/updater.php
index 7f1a493d2a0..bd9e8a65363 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -386,6 +386,7 @@ class Updater extends BasicEmitter {
foreach ($stacks as $type => $stack) {
foreach ($stack as $appId) {
if (\OC_App::shouldUpgrade($appId)) {
+ $this->emit('\OC\Updater', 'appUpgradeStarted', array($appId, \OC_App::getAppVersion($appId)));
\OC_App::updateApp($appId);
$this->emit('\OC\Updater', 'appUpgrade', array($appId, \OC_App::getAppVersion($appId)));
}