diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-27 11:51:02 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-28 14:52:01 +0300 |
commit | bbd2a07525db6b70645720f4c022b5562543127e (patch) | |
tree | ce97cb458ce1e7098bee4a49de707d07e76cab47 /lib/private/updater.php | |
parent | cdcd49b473dc7bad4ffb500977b2b8ea5d6f676e (diff) |
Remove emitter from class Repair
Diffstat (limited to 'lib/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index 66f410b779f..093ebebbbe4 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -132,6 +132,8 @@ class Updater extends BasicEmitter { * @return bool true if the operation succeeded, false otherwise */ public function upgrade() { + $this->emitRepairEvents(); + $logLevel = $this->config->getSystemValue('loglevel', \OCP\Util::WARN); $this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]); $this->config->setSystemValue('loglevel', \OCP\Util::DEBUG); @@ -196,26 +198,6 @@ 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)); - }); - $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)); - }); - } - - /** * runs the update actions in maintenance mode, does not upgrade the source files * except the main .htaccess file * @@ -245,8 +227,7 @@ class Updater extends BasicEmitter { file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', ''); // pre-upgrade repairs - $repair = new Repair(Repair::getBeforeUpgradeRepairSteps()); - $this->emitRepairMessages($repair); + $repair = new Repair(Repair::getBeforeUpgradeRepairSteps(), \OC::$server->getEventDispatcher()); $repair->run(); // simulate DB upgrade @@ -278,8 +259,7 @@ class Updater extends BasicEmitter { } // post-upgrade repairs - $repair = new Repair(Repair::getRepairSteps()); - $this->emitRepairMessages($repair); + $repair = new Repair(Repair::getRepairSteps(), \OC::$server->getEventDispatcher()); $repair->run(); //Invalidate update feed @@ -362,7 +342,6 @@ class Updater extends BasicEmitter { * @throws NeedsUpdateException */ protected function doAppUpgrade() { - $this->emitRepairEvents(); $apps = \OC_App::getEnabledApps(); $priorityTypes = array('authentication', 'filesystem', 'logging'); $pseudoOtherType = 'other'; |