[upgrade] print update message before running the update code

* otherwise you don't know during which app update something failed
This commit is contained in:
Morris Jobke 2015-06-23 10:43:45 +02:00
parent 2654696086
commit 1ba9fd3ada
2 changed files with 4 additions and 0 deletions

View File

@ -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>");
});

View File

@ -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)));
}