summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-01 08:55:32 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-01 08:55:32 +0200
commit4e44cc49d905171374768a29f5af826092915b8c (patch)
tree545c85a88420048581f2c2eca3580788aed25f43 /core
parentda45fad3eb1ae0ef02b1cb30e238a29faaeecfa4 (diff)
parentdba5d5e2057ae51ef73644bf1feeb16e60a99afa (diff)
downloadnextcloud-server-4e44cc49d905171374768a29f5af826092915b8c.tar.gz
nextcloud-server-4e44cc49d905171374768a29f5af826092915b8c.zip
Merge pull request #17093 from owncloud/upgrade-timestamp
[upgrade] show timestamp for output during upgrade
Diffstat (limited to 'core')
-rw-r--r--core/command/upgrade.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index ac0d72a8940..14478f88b05 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -26,6 +26,7 @@
namespace OC\Core\Command;
+use OC\Console\TimestampFormatter;
use OC\Updater;
use OCP\IConfig;
use Symfony\Component\Console\Command\Command;
@@ -110,6 +111,12 @@ class Upgrade extends Command {
}
if(\OC::checkUpgrade(false)) {
+ if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) {
+ // Prepend each line with a little timestamp
+ $timestampFormatter = new TimestampFormatter($this->config, $output->getFormatter());
+ $output->setFormatter($timestampFormatter);
+ }
+
$self = $this;
$updater = new Updater(\OC::$server->getHTTPHelper(),
\OC::$server->getConfig());
@@ -130,9 +137,11 @@ class Upgrade extends Command {
$updater->listen('\OC\Updater', 'updateEnd',
function ($success) use($output, $updateStepEnabled, $self) {
$mode = $updateStepEnabled ? 'Update' : 'Update simulation';
- $status = $success ? 'successful' : 'failed' ;
- $type = $success ? 'info' : 'error';
- $message = "<$type>$mode $status</$type>";
+ if ($success) {
+ $message = "<info>$mode successful</info>";
+ } else {
+ $message = "<error>$mode failed</error>";
+ }
$output->writeln($message);
});
$updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) {