Merge pull request #17088 from owncloud/add-verbosity-to-upgrade

[upgrade] add verbosity check and show repair info & steps
remotes/origin/handlebars-approach
Morris Jobke 10 years ago
commit b5c9196ffc
  1. 9
      core/command/upgrade.php
  2. 6
      lib/private/updater.php
  3. 1
      lib/repair/collation.php

@ -178,6 +178,15 @@ class Upgrade extends Command {
$output->writeln("<error>$message</error>");
});
if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) {
$updater->listen('\OC\Updater', 'repairInfo', function ($message) use($output) {
$output->writeln('<info>Repair info: ' . $message . '</info>');
});
$updater->listen('\OC\Updater', 'repairStep', function ($message) use($output) {
$output->writeln('<info>Repair step: ' . $message . '</info>');
});
}
$success = $updater->upgrade();
$this->postUpgradeCheck($input, $output);

@ -239,6 +239,12 @@ class Updater extends BasicEmitter {
$repair->listen('\OC\Repair', 'error', function ($description) {
$this->emit('\OC\Updater', 'repairError', array($description));
});
$repair->listen('\OC\Repair', 'info', function ($description) {
$this->emit('\OC\Updater', 'repairInfo', array($description));
});
$repair->listen('\OC\Repair', 'step', function ($description) {
$this->emit('\OC\Updater', 'repairStep', array($description));
});
}
/**

@ -60,6 +60,7 @@ class Collation extends BasicEmitter implements \OC\RepairStep {
$tables = $this->getAllNonUTF8BinTables($this->connection);
foreach ($tables as $table) {
$this->emit('\OC\Repair', 'info', array("Change collation for $table ..."));
$query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;');
$query->execute();
}

Loading…
Cancel
Save