diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-27 12:21:31 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-28 13:52:01 +0200 |
commit | 821d8736c89eae3ad35c0ddc726a583b0c0cf99c (patch) | |
tree | 02a96643204969d6927c9ac41cef9ecdcb1f4519 /lib | |
parent | bbd2a07525db6b70645720f4c022b5562543127e (diff) | |
download | nextcloud-server-821d8736c89eae3ad35c0ddc726a583b0c0cf99c.tar.gz nextcloud-server-821d8736c89eae3ad35c0ddc726a583b0c0cf99c.zip |
Adding progress to web upgrade
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Repair/DropOldTables.php | 2 | ||||
-rw-r--r-- | lib/private/repair.php | 12 | ||||
-rw-r--r-- | lib/public/migration/ioutput.php | 3 |
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/private/Repair/DropOldTables.php b/lib/private/Repair/DropOldTables.php index 59e8487c2a3..b9963b50775 100644 --- a/lib/private/Repair/DropOldTables.php +++ b/lib/private/Repair/DropOldTables.php @@ -61,7 +61,7 @@ class DropOldTables implements IRepairStep { if ($this->connection->tableExists($tableName)){ $this->connection->dropTable($tableName); } - $output->advance(); + $output->advance(1, "Drop old database table: $tableName"); } $output->finishProgress(); } diff --git a/lib/private/repair.php b/lib/private/repair.php index c6887ab5ce6..590b0bee721 100644 --- a/lib/private/repair.php +++ b/lib/private/repair.php @@ -55,6 +55,8 @@ class Repair implements IOutput{ private $repairSteps; /** @var EventDispatcher */ private $dispatcher; + /** @var string */ + private $currentStep; /** * Creates a new repair step runner @@ -78,7 +80,8 @@ class Repair implements IOutput{ } // run each repair step foreach ($this->repairSteps as $step) { - $this->emit('\OC\Repair', 'step', array($step->getName())); + $this->currentStep = $step->getName(); + $this->emit('\OC\Repair', 'step', [$this->currentStep]); if ($step instanceof Emitter) { $step->listen('\OC\Repair', 'warning', function ($description) use ($self) { @@ -206,15 +209,16 @@ class Repair implements IOutput{ */ public function startProgress($max = 0) { // for now just emit as we did in the past - $this->emit('\OC\Repair', 'startProgress', [$max]); + $this->emit('\OC\Repair', 'startProgress', [$max, $this->currentStep]); } /** * @param int $step + * @param string $description */ - public function advance($step = 1) { + public function advance($step = 1, $description = '') { // for now just emit as we did in the past - $this->emit('\OC\Repair', 'advance', [$step]); + $this->emit('\OC\Repair', 'advance', [$step, $description]); } /** diff --git a/lib/public/migration/ioutput.php b/lib/public/migration/ioutput.php index c52f13b31dc..d3b43028495 100644 --- a/lib/public/migration/ioutput.php +++ b/lib/public/migration/ioutput.php @@ -48,9 +48,10 @@ interface IOutput { /** * @param int $step + * @param string $description * @since 9.1.0 */ - public function advance($step = 1); + public function advance($step = 1, $description = ''); /** * @param int $max |