Merge pull request #17090 from owncloud/upgrade-app-info

[upgrade] print update message before running the update code
This commit is contained in:
Jörn Friedrich Dreyer 2015-06-23 13:14:35 +02:00
commit 4b5324341c
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)));
}