diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-02-27 12:44:04 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-02-27 12:44:04 +0100 |
commit | 22bc37cb82368fba912a9e5a5ef0e87017d04b1e (patch) | |
tree | 42a7a13fff923c1df9703300ee830110c40656c4 /lib/private/updater.php | |
parent | e6abe96374d31ba4c44103b822ee826ea6e5a927 (diff) | |
download | nextcloud-server-22bc37cb82368fba912a9e5a5ef0e87017d04b1e.tar.gz nextcloud-server-22bc37cb82368fba912a9e5a5ef0e87017d04b1e.zip |
Properly forward repair errors and warnings
This makes repair errors and warnings visible for the user when
upgrading on the command line or in the web UI.
Diffstat (limited to 'lib/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index 71ada3217e0..302003e666c 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -173,6 +173,20 @@ class Updater extends BasicEmitter { } /** + * Forward messages emitted by the repair routine + * + * @param Repair $repair repair routine + */ + private function emitRepairMessages(Repair $repair) { + $repair->listen('\OC\Repair', 'warning', function ($description) { + $this->emit('\OC\Updater', 'repairWarning', array($description)); + }); + $repair->listen('\OC\Repair', 'error', function ($description) { + $this->emit('\OC\Updater', 'repairError', array($description)); + }); + } + + /** * runs the update actions in maintenance mode, does not upgrade the source files * except the main .htaccess file * @@ -204,6 +218,7 @@ class Updater extends BasicEmitter { // pre-upgrade repairs $repair = new Repair(Repair::getBeforeUpgradeRepairSteps()); + $this->emitRepairMessages($repair); $repair->run(); // simulate DB upgrade @@ -223,6 +238,7 @@ class Updater extends BasicEmitter { // post-upgrade repairs $repair = new Repair(Repair::getRepairSteps()); + $this->emitRepairMessages($repair); $repair->run(); //Invalidate update feed |