@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // If at least PHP 7.0.0 is used we don't need to disable apps as we catch |
| 87 | 87 | // fatal errors and exceptions and disable the app just instead. |
| 88 | - if(version_compare(phpversion(), '7.0.0', '>=')) { |
|
| 88 | + if (version_compare(phpversion(), '7.0.0', '>=')) { |
|
| 89 | 89 | $this->skip3rdPartyAppsDisable = true; |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -111,43 +111,43 @@ discard block |
||
| 111 | 111 | $this->logAllEvents(); |
| 112 | 112 | |
| 113 | 113 | $logLevel = $this->config->getSystemValue('loglevel', Util::WARN); |
| 114 | - $this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]); |
|
| 114 | + $this->emit('\OC\Updater', 'setDebugLogLevel', [$logLevel, $this->logLevelNames[$logLevel]]); |
|
| 115 | 115 | $this->config->setSystemValue('loglevel', Util::DEBUG); |
| 116 | 116 | |
| 117 | 117 | $wasMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
| 118 | 118 | |
| 119 | - if(!$wasMaintenanceModeEnabled) { |
|
| 119 | + if (!$wasMaintenanceModeEnabled) { |
|
| 120 | 120 | $this->config->setSystemValue('maintenance', true); |
| 121 | 121 | $this->emit('\OC\Updater', 'maintenanceEnabled'); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $installedVersion = $this->config->getSystemValue('version', '0.0.0'); |
| 125 | 125 | $currentVersion = implode('.', \OCP\Util::getVersion()); |
| 126 | - $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); |
|
| 126 | + $this->log->debug('starting upgrade from '.$installedVersion.' to '.$currentVersion, array('app' => 'core')); |
|
| 127 | 127 | |
| 128 | 128 | $success = true; |
| 129 | 129 | try { |
| 130 | 130 | $this->doUpgrade($currentVersion, $installedVersion); |
| 131 | 131 | } catch (HintException $exception) { |
| 132 | 132 | $this->log->logException($exception, ['app' => 'core']); |
| 133 | - $this->emit('\OC\Updater', 'failure', array($exception->getMessage() . ': ' .$exception->getHint())); |
|
| 133 | + $this->emit('\OC\Updater', 'failure', array($exception->getMessage().': '.$exception->getHint())); |
|
| 134 | 134 | $success = false; |
| 135 | 135 | } catch (\Exception $exception) { |
| 136 | 136 | $this->log->logException($exception, ['app' => 'core']); |
| 137 | - $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage())); |
|
| 137 | + $this->emit('\OC\Updater', 'failure', array(get_class($exception).': '.$exception->getMessage())); |
|
| 138 | 138 | $success = false; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $this->emit('\OC\Updater', 'updateEnd', array($success)); |
| 142 | 142 | |
| 143 | - if(!$wasMaintenanceModeEnabled && $success) { |
|
| 143 | + if (!$wasMaintenanceModeEnabled && $success) { |
|
| 144 | 144 | $this->config->setSystemValue('maintenance', false); |
| 145 | 145 | $this->emit('\OC\Updater', 'maintenanceDisabled'); |
| 146 | 146 | } else { |
| 147 | 147 | $this->emit('\OC\Updater', 'maintenanceActive'); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $this->emit('\OC\Updater', 'resetLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]); |
|
| 150 | + $this->emit('\OC\Updater', 'resetLogLevel', [$logLevel, $this->logLevelNames[$logLevel]]); |
|
| 151 | 151 | $this->config->setSystemValue('loglevel', $logLevel); |
| 152 | 152 | $this->config->setSystemValue('installed', true); |
| 153 | 153 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private function getAllowedPreviousVersions() { |
| 163 | 163 | // this should really be a JSON file |
| 164 | - require \OC::$SERVERROOT . '/version.php'; |
|
| 164 | + require \OC::$SERVERROOT.'/version.php'; |
|
| 165 | 165 | /** @var array $OC_VersionCanBeUpgradedFrom */ |
| 166 | 166 | return $OC_VersionCanBeUpgradedFrom; |
| 167 | 167 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | private function getVendor() { |
| 175 | 175 | // this should really be a JSON file |
| 176 | - require \OC::$SERVERROOT . '/version.php'; |
|
| 176 | + require \OC::$SERVERROOT.'/version.php'; |
|
| 177 | 177 | /** @var string $vendor */ |
| 178 | 178 | return (string) $vendor; |
| 179 | 179 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function isUpgradePossible($oldVersion, $newVersion, array $allowedPreviousVersions) { |
| 189 | 189 | $version = explode('.', $oldVersion); |
| 190 | - $majorMinor = $version[0] . '.' . $version[1]; |
|
| 190 | + $majorMinor = $version[0].'.'.$version[1]; |
|
| 191 | 191 | |
| 192 | 192 | $currentVendor = $this->config->getAppValue('core', 'vendor', ''); |
| 193 | 193 | if ($currentVendor === 'nextcloud') { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | // create empty file in data dir, so we can later find |
| 228 | 228 | // out that this is indeed an ownCloud data directory |
| 229 | 229 | // (in case it didn't exist before) |
| 230 | - file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', ''); |
|
| 230 | + file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/.ocdata', ''); |
|
| 231 | 231 | |
| 232 | 232 | // pre-upgrade repairs |
| 233 | 233 | $repair = new Repair(Repair::getBeforeUpgradeRepairSteps(), \OC::$server->getEventDispatcher()); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | foreach ($errors as $appId => $exception) { |
| 259 | 259 | /** @var \Exception $exception */ |
| 260 | 260 | $this->log->logException($exception, ['app' => $appId]); |
| 261 | - $this->emit('\OC\Updater', 'failure', [$appId . ': ' . $exception->getMessage()]); |
|
| 261 | + $this->emit('\OC\Updater', 'failure', [$appId.': '.$exception->getMessage()]); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | // post-upgrade repairs |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $this->config->setAppValue('core', 'lastupdatedat', 0); |
| 270 | 270 | |
| 271 | 271 | // Check for code integrity if not disabled |
| 272 | - if(\OC::$server->getIntegrityCodeChecker()->isCodeCheckEnforced()) { |
|
| 272 | + if (\OC::$server->getIntegrityCodeChecker()->isCodeCheckEnforced()) { |
|
| 273 | 273 | $this->emit('\OC\Updater', 'startCheckCodeIntegrity'); |
| 274 | 274 | $this->checker->runInstanceVerification(); |
| 275 | 275 | $this->emit('\OC\Updater', 'finishedCheckCodeIntegrity'); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | $this->emit('\OC\Updater', 'dbUpgradeBefore'); |
| 285 | 285 | |
| 286 | 286 | // do the real upgrade |
| 287 | - \OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml'); |
|
| 287 | + \OC_DB::updateDbFromStructure(\OC::$SERVERROOT.'/db_structure.xml'); |
|
| 288 | 288 | |
| 289 | 289 | $this->emit('\OC\Updater', 'dbUpgrade'); |
| 290 | 290 | } |
@@ -308,12 +308,12 @@ discard block |
||
| 308 | 308 | * @link https://github.com/owncloud/core/issues/10980 |
| 309 | 309 | * @see \OC_App::updateApp |
| 310 | 310 | */ |
| 311 | - if (file_exists(\OC_App::getAppPath($appId) . '/appinfo/preupdate.php')) { |
|
| 311 | + if (file_exists(\OC_App::getAppPath($appId).'/appinfo/preupdate.php')) { |
|
| 312 | 312 | $this->includePreUpdate($appId); |
| 313 | 313 | } |
| 314 | - if (file_exists(\OC_App::getAppPath($appId) . '/appinfo/database.xml')) { |
|
| 314 | + if (file_exists(\OC_App::getAppPath($appId).'/appinfo/database.xml')) { |
|
| 315 | 315 | $this->emit('\OC\Updater', 'appSimulateUpdate', array($appId)); |
| 316 | - \OC_DB::simulateUpdateDbFromStructure(\OC_App::getAppPath($appId) . '/appinfo/database.xml'); |
|
| 316 | + \OC_DB::simulateUpdateDbFromStructure(\OC_App::getAppPath($appId).'/appinfo/database.xml'); |
|
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | } |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @param string $appId |
| 327 | 327 | */ |
| 328 | 328 | private function includePreUpdate($appId) { |
| 329 | - include \OC_App::getAppPath($appId) . '/appinfo/preupdate.php'; |
|
| 329 | + include \OC_App::getAppPath($appId).'/appinfo/preupdate.php'; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | foreach ($apps as $appId) { |
| 345 | 345 | $priorityType = false; |
| 346 | 346 | foreach ($priorityTypes as $type) { |
| 347 | - if(!isset($stacks[$type])) { |
|
| 347 | + if (!isset($stacks[$type])) { |
|
| 348 | 348 | $stacks[$type] = array(); |
| 349 | 349 | } |
| 350 | 350 | if (\OC_App::isType($appId, $type)) { |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | \OC_App::updateApp($appId); |
| 365 | 365 | $this->emit('\OC\Updater', 'appUpgrade', [$appId, \OC_App::getAppVersion($appId)]); |
| 366 | 366 | } |
| 367 | - if($type !== $pseudoOtherType) { |
|
| 367 | + if ($type !== $pseudoOtherType) { |
|
| 368 | 368 | // load authentication, filesystem and logging apps after |
| 369 | 369 | // upgrading them. Other apps my need to rely on modifying |
| 370 | 370 | // user and/or filesystem aspects. |
@@ -391,9 +391,9 @@ discard block |
||
| 391 | 391 | foreach ($apps as $app) { |
| 392 | 392 | // check if the app is compatible with this version of ownCloud |
| 393 | 393 | $info = OC_App::getAppInfo($app); |
| 394 | - if(!OC_App::isAppCompatible($version, $info)) { |
|
| 394 | + if (!OC_App::isAppCompatible($version, $info)) { |
|
| 395 | 395 | if (OC_App::isShipped($app)) { |
| 396 | - throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update'); |
|
| 396 | + throw new \UnexpectedValueException('The files of the app "'.$app.'" were not correctly replaced before running the update'); |
|
| 397 | 397 | } |
| 398 | 398 | OC_App::disable($app); |
| 399 | 399 | $this->emit('\OC\Updater', 'incompatibleAppDisabled', array($app)); |
@@ -412,9 +412,9 @@ discard block |
||
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | // disable any other 3rd party apps if not overriden |
| 415 | - if(!$this->skip3rdPartyAppsDisable) { |
|
| 415 | + if (!$this->skip3rdPartyAppsDisable) { |
|
| 416 | 416 | \OC_App::disable($app); |
| 417 | - $disabledApps[]= $app; |
|
| 417 | + $disabledApps[] = $app; |
|
| 418 | 418 | $this->emit('\OC\Updater', 'thirdPartyAppDisabled', array($app)); |
| 419 | 419 | }; |
| 420 | 420 | } |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | * @throws \Exception |
| 439 | 439 | */ |
| 440 | 440 | private function upgradeAppStoreApps(array $disabledApps) { |
| 441 | - foreach($disabledApps as $app) { |
|
| 441 | + foreach ($disabledApps as $app) { |
|
| 442 | 442 | try { |
| 443 | 443 | $installer = new Installer( |
| 444 | 444 | \OC::$server->getAppFetcher(), |
@@ -464,22 +464,22 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | private function emitRepairEvents() { |
| 466 | 466 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 467 | - $dispatcher->addListener('\OC\Repair::warning', function ($event) { |
|
| 467 | + $dispatcher->addListener('\OC\Repair::warning', function($event) { |
|
| 468 | 468 | if ($event instanceof GenericEvent) { |
| 469 | 469 | $this->emit('\OC\Updater', 'repairWarning', $event->getArguments()); |
| 470 | 470 | } |
| 471 | 471 | }); |
| 472 | - $dispatcher->addListener('\OC\Repair::error', function ($event) { |
|
| 472 | + $dispatcher->addListener('\OC\Repair::error', function($event) { |
|
| 473 | 473 | if ($event instanceof GenericEvent) { |
| 474 | 474 | $this->emit('\OC\Updater', 'repairError', $event->getArguments()); |
| 475 | 475 | } |
| 476 | 476 | }); |
| 477 | - $dispatcher->addListener('\OC\Repair::info', function ($event) { |
|
| 477 | + $dispatcher->addListener('\OC\Repair::info', function($event) { |
|
| 478 | 478 | if ($event instanceof GenericEvent) { |
| 479 | 479 | $this->emit('\OC\Updater', 'repairInfo', $event->getArguments()); |
| 480 | 480 | } |
| 481 | 481 | }); |
| 482 | - $dispatcher->addListener('\OC\Repair::step', function ($event) { |
|
| 482 | + $dispatcher->addListener('\OC\Repair::step', function($event) { |
|
| 483 | 483 | if ($event instanceof GenericEvent) { |
| 484 | 484 | $this->emit('\OC\Updater', 'repairStep', $event->getArguments()); |
| 485 | 485 | } |
@@ -494,13 +494,13 @@ discard block |
||
| 494 | 494 | if (!$event instanceof GenericEvent) { |
| 495 | 495 | return; |
| 496 | 496 | } |
| 497 | - $log->info('\OC\DB\Migrator::executeSql: ' . $event->getSubject() . ' (' . $event->getArgument(0) . ' of ' . $event->getArgument(1) . ')', ['app' => 'updater']); |
|
| 497 | + $log->info('\OC\DB\Migrator::executeSql: '.$event->getSubject().' ('.$event->getArgument(0).' of '.$event->getArgument(1).')', ['app' => 'updater']); |
|
| 498 | 498 | }); |
| 499 | 499 | $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($log) { |
| 500 | 500 | if (!$event instanceof GenericEvent) { |
| 501 | 501 | return; |
| 502 | 502 | } |
| 503 | - $log->info('\OC\DB\Migrator::checkTable: ' . $event->getSubject() . ' (' . $event->getArgument(0) . ' of ' . $event->getArgument(1) . ')', ['app' => 'updater']); |
|
| 503 | + $log->info('\OC\DB\Migrator::checkTable: '.$event->getSubject().' ('.$event->getArgument(0).' of '.$event->getArgument(1).')', ['app' => 'updater']); |
|
| 504 | 504 | }); |
| 505 | 505 | |
| 506 | 506 | $repairListener = function($event) use ($log) { |
@@ -509,30 +509,30 @@ discard block |
||
| 509 | 509 | } |
| 510 | 510 | switch ($event->getSubject()) { |
| 511 | 511 | case '\OC\Repair::startProgress': |
| 512 | - $log->info('\OC\Repair::startProgress: Starting ... ' . $event->getArgument(1) . ' (' . $event->getArgument(0) . ')', ['app' => 'updater']); |
|
| 512 | + $log->info('\OC\Repair::startProgress: Starting ... '.$event->getArgument(1).' ('.$event->getArgument(0).')', ['app' => 'updater']); |
|
| 513 | 513 | break; |
| 514 | 514 | case '\OC\Repair::advance': |
| 515 | 515 | $desc = $event->getArgument(1); |
| 516 | 516 | if (empty($desc)) { |
| 517 | 517 | $desc = ''; |
| 518 | 518 | } |
| 519 | - $log->info('\OC\Repair::advance: ' . $desc . ' (' . $event->getArgument(0) . ')', ['app' => 'updater']); |
|
| 519 | + $log->info('\OC\Repair::advance: '.$desc.' ('.$event->getArgument(0).')', ['app' => 'updater']); |
|
| 520 | 520 | |
| 521 | 521 | break; |
| 522 | 522 | case '\OC\Repair::finishProgress': |
| 523 | 523 | $log->info('\OC\Repair::finishProgress', ['app' => 'updater']); |
| 524 | 524 | break; |
| 525 | 525 | case '\OC\Repair::step': |
| 526 | - $log->info('\OC\Repair::step: Repair step: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 526 | + $log->info('\OC\Repair::step: Repair step: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 527 | 527 | break; |
| 528 | 528 | case '\OC\Repair::info': |
| 529 | - $log->info('\OC\Repair::info: Repair info: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 529 | + $log->info('\OC\Repair::info: Repair info: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 530 | 530 | break; |
| 531 | 531 | case '\OC\Repair::warning': |
| 532 | - $log->warning('\OC\Repair::warning: Repair warning: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 532 | + $log->warning('\OC\Repair::warning: Repair warning: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 533 | 533 | break; |
| 534 | 534 | case '\OC\Repair::error': |
| 535 | - $log->error('\OC\Repair::error: Repair error: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 535 | + $log->error('\OC\Repair::error: Repair error: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 536 | 536 | break; |
| 537 | 537 | } |
| 538 | 538 | }; |
@@ -546,77 +546,77 @@ discard block |
||
| 546 | 546 | $dispatcher->addListener('\OC\Repair::error', $repairListener); |
| 547 | 547 | |
| 548 | 548 | |
| 549 | - $this->listen('\OC\Updater', 'maintenanceEnabled', function () use($log) { |
|
| 549 | + $this->listen('\OC\Updater', 'maintenanceEnabled', function() use($log) { |
|
| 550 | 550 | $log->info('\OC\Updater::maintenanceEnabled: Turned on maintenance mode', ['app' => 'updater']); |
| 551 | 551 | }); |
| 552 | - $this->listen('\OC\Updater', 'maintenanceDisabled', function () use($log) { |
|
| 552 | + $this->listen('\OC\Updater', 'maintenanceDisabled', function() use($log) { |
|
| 553 | 553 | $log->info('\OC\Updater::maintenanceDisabled: Turned off maintenance mode', ['app' => 'updater']); |
| 554 | 554 | }); |
| 555 | - $this->listen('\OC\Updater', 'maintenanceActive', function () use($log) { |
|
| 555 | + $this->listen('\OC\Updater', 'maintenanceActive', function() use($log) { |
|
| 556 | 556 | $log->info('\OC\Updater::maintenanceActive: Maintenance mode is kept active', ['app' => 'updater']); |
| 557 | 557 | }); |
| 558 | - $this->listen('\OC\Updater', 'updateEnd', function ($success) use($log) { |
|
| 558 | + $this->listen('\OC\Updater', 'updateEnd', function($success) use($log) { |
|
| 559 | 559 | if ($success) { |
| 560 | 560 | $log->info('\OC\Updater::updateEnd: Update successful', ['app' => 'updater']); |
| 561 | 561 | } else { |
| 562 | 562 | $log->error('\OC\Updater::updateEnd: Update failed', ['app' => 'updater']); |
| 563 | 563 | } |
| 564 | 564 | }); |
| 565 | - $this->listen('\OC\Updater', 'dbUpgradeBefore', function () use($log) { |
|
| 565 | + $this->listen('\OC\Updater', 'dbUpgradeBefore', function() use($log) { |
|
| 566 | 566 | $log->info('\OC\Updater::dbUpgradeBefore: Updating database schema', ['app' => 'updater']); |
| 567 | 567 | }); |
| 568 | - $this->listen('\OC\Updater', 'dbUpgrade', function () use($log) { |
|
| 568 | + $this->listen('\OC\Updater', 'dbUpgrade', function() use($log) { |
|
| 569 | 569 | $log->info('\OC\Updater::dbUpgrade: Updated database', ['app' => 'updater']); |
| 570 | 570 | }); |
| 571 | - $this->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($log) { |
|
| 571 | + $this->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function() use($log) { |
|
| 572 | 572 | $log->info('\OC\Updater::dbSimulateUpgradeBefore: Checking whether the database schema can be updated (this can take a long time depending on the database size)', ['app' => 'updater']); |
| 573 | 573 | }); |
| 574 | - $this->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($log) { |
|
| 574 | + $this->listen('\OC\Updater', 'dbSimulateUpgrade', function() use($log) { |
|
| 575 | 575 | $log->info('\OC\Updater::dbSimulateUpgrade: Checked database schema update', ['app' => 'updater']); |
| 576 | 576 | }); |
| 577 | - $this->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($log) { |
|
| 578 | - $log->info('\OC\Updater::incompatibleAppDisabled: Disabled incompatible app: ' . $app, ['app' => 'updater']); |
|
| 577 | + $this->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use($log) { |
|
| 578 | + $log->info('\OC\Updater::incompatibleAppDisabled: Disabled incompatible app: '.$app, ['app' => 'updater']); |
|
| 579 | 579 | }); |
| 580 | - $this->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($log) { |
|
| 581 | - $log->info('\OC\Updater::thirdPartyAppDisabled: Disabled 3rd-party app: ' . $app, ['app' => 'updater']); |
|
| 580 | + $this->listen('\OC\Updater', 'thirdPartyAppDisabled', function($app) use ($log) { |
|
| 581 | + $log->info('\OC\Updater::thirdPartyAppDisabled: Disabled 3rd-party app: '.$app, ['app' => 'updater']); |
|
| 582 | 582 | }); |
| 583 | - $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($log) { |
|
| 584 | - $log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "' . $app . '" in appstore', ['app' => 'updater']); |
|
| 583 | + $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use($log) { |
|
| 584 | + $log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "'.$app.'" in appstore', ['app' => 'updater']); |
|
| 585 | 585 | }); |
| 586 | - $this->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($log) { |
|
| 587 | - $log->info('\OC\Updater::upgradeAppStoreApp: Update app "' . $app . '" from appstore', ['app' => 'updater']); |
|
| 586 | + $this->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use($log) { |
|
| 587 | + $log->info('\OC\Updater::upgradeAppStoreApp: Update app "'.$app.'" from appstore', ['app' => 'updater']); |
|
| 588 | 588 | }); |
| 589 | - $this->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($log) { |
|
| 590 | - $log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "' . $app . '" in appstore', ['app' => 'updater']); |
|
| 589 | + $this->listen('\OC\Updater', 'checkAppStoreApp', function($app) use($log) { |
|
| 590 | + $log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "'.$app.'" in appstore', ['app' => 'updater']); |
|
| 591 | 591 | }); |
| 592 | - $this->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($log) { |
|
| 592 | + $this->listen('\OC\Updater', 'appUpgradeCheckBefore', function() use ($log) { |
|
| 593 | 593 | $log->info('\OC\Updater::appUpgradeCheckBefore: Checking updates of apps', ['app' => 'updater']); |
| 594 | 594 | }); |
| 595 | - $this->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($log) { |
|
| 596 | - $log->info('\OC\Updater::appSimulateUpdate: Checking whether the database schema for <' . $app . '> can be updated (this can take a long time depending on the database size)', ['app' => 'updater']); |
|
| 595 | + $this->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($log) { |
|
| 596 | + $log->info('\OC\Updater::appSimulateUpdate: Checking whether the database schema for <'.$app.'> can be updated (this can take a long time depending on the database size)', ['app' => 'updater']); |
|
| 597 | 597 | }); |
| 598 | - $this->listen('\OC\Updater', 'appUpgradeCheck', function () use ($log) { |
|
| 598 | + $this->listen('\OC\Updater', 'appUpgradeCheck', function() use ($log) { |
|
| 599 | 599 | $log->info('\OC\Updater::appUpgradeCheck: Checked database schema update for apps', ['app' => 'updater']); |
| 600 | 600 | }); |
| 601 | - $this->listen('\OC\Updater', 'appUpgradeStarted', function ($app) use ($log) { |
|
| 602 | - $log->info('\OC\Updater::appUpgradeStarted: Updating <' . $app . '> ...', ['app' => 'updater']); |
|
| 601 | + $this->listen('\OC\Updater', 'appUpgradeStarted', function($app) use ($log) { |
|
| 602 | + $log->info('\OC\Updater::appUpgradeStarted: Updating <'.$app.'> ...', ['app' => 'updater']); |
|
| 603 | 603 | }); |
| 604 | - $this->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($log) { |
|
| 605 | - $log->info('\OC\Updater::appUpgrade: Updated <' . $app . '> to ' . $version, ['app' => 'updater']); |
|
| 604 | + $this->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($log) { |
|
| 605 | + $log->info('\OC\Updater::appUpgrade: Updated <'.$app.'> to '.$version, ['app' => 'updater']); |
|
| 606 | 606 | }); |
| 607 | - $this->listen('\OC\Updater', 'failure', function ($message) use($log) { |
|
| 608 | - $log->error('\OC\Updater::failure: ' . $message, ['app' => 'updater']); |
|
| 607 | + $this->listen('\OC\Updater', 'failure', function($message) use($log) { |
|
| 608 | + $log->error('\OC\Updater::failure: '.$message, ['app' => 'updater']); |
|
| 609 | 609 | }); |
| 610 | - $this->listen('\OC\Updater', 'setDebugLogLevel', function () use($log) { |
|
| 610 | + $this->listen('\OC\Updater', 'setDebugLogLevel', function() use($log) { |
|
| 611 | 611 | $log->info('\OC\Updater::setDebugLogLevel: Set log level to debug', ['app' => 'updater']); |
| 612 | 612 | }); |
| 613 | - $this->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($log) { |
|
| 614 | - $log->info('\OC\Updater::resetLogLevel: Reset log level to ' . $logLevelName . '(' . $logLevel . ')', ['app' => 'updater']); |
|
| 613 | + $this->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use($log) { |
|
| 614 | + $log->info('\OC\Updater::resetLogLevel: Reset log level to '.$logLevelName.'('.$logLevel.')', ['app' => 'updater']); |
|
| 615 | 615 | }); |
| 616 | - $this->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($log) { |
|
| 616 | + $this->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use($log) { |
|
| 617 | 617 | $log->info('\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...', ['app' => 'updater']); |
| 618 | 618 | }); |
| 619 | - $this->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($log) { |
|
| 619 | + $this->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use($log) { |
|
| 620 | 620 | $log->info('\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check', ['app' => 'updater']); |
| 621 | 621 | }); |
| 622 | 622 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | // need to send an initial message to force-init the event source, |
| 42 | 42 | // which will then trigger its own CSRF check and produces its own CSRF error |
| 43 | 43 | // message |
| 44 | -$eventSource->send('success', (string)$l->t('Preparing update')); |
|
| 44 | +$eventSource->send('success', (string) $l->t('Preparing update')); |
|
| 45 | 45 | |
| 46 | 46 | class FeedBackHandler { |
| 47 | 47 | /** @var integer */ |
@@ -73,21 +73,21 @@ discard block |
||
| 73 | 73 | if (empty($desc)) { |
| 74 | 74 | $desc = $this->currentStep; |
| 75 | 75 | } |
| 76 | - $this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc])); |
|
| 76 | + $this->eventSource->send('success', (string) $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc])); |
|
| 77 | 77 | break; |
| 78 | 78 | case '\OC\Repair::finishProgress': |
| 79 | 79 | $this->progressStateMax = $this->progressStateStep; |
| 80 | - $this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep])); |
|
| 80 | + $this->eventSource->send('success', (string) $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep])); |
|
| 81 | 81 | break; |
| 82 | 82 | case '\OC\Repair::step': |
| 83 | 83 | break; |
| 84 | 84 | case '\OC\Repair::info': |
| 85 | 85 | break; |
| 86 | 86 | case '\OC\Repair::warning': |
| 87 | - $this->eventSource->send('notice', (string)$this->l10n->t('Repair warning: ') . $event->getArgument(0)); |
|
| 87 | + $this->eventSource->send('notice', (string) $this->l10n->t('Repair warning: ').$event->getArgument(0)); |
|
| 88 | 88 | break; |
| 89 | 89 | case '\OC\Repair::error': |
| 90 | - $this->eventSource->send('notice', (string)$this->l10n->t('Repair error: ') . $event->getArgument(0)); |
|
| 90 | + $this->eventSource->send('notice', (string) $this->l10n->t('Repair error: ').$event->getArgument(0)); |
|
| 91 | 91 | break; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $config = \OC::$server->getSystemConfig(); |
| 99 | 99 | if ($config->getValue('upgrade.disable-web', false)) { |
| 100 | - $eventSource->send('failure', (string)$l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); |
|
| 100 | + $eventSource->send('failure', (string) $l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); |
|
| 101 | 101 | $eventSource->close(); |
| 102 | 102 | exit(); |
| 103 | 103 | } |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 120 | 120 | $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($eventSource, $l) { |
| 121 | 121 | if ($event instanceof GenericEvent) { |
| 122 | - $eventSource->send('success', (string)$l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 122 | + $eventSource->send('success', (string) $l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | 125 | $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($eventSource, $l) { |
| 126 | 126 | if ($event instanceof GenericEvent) { |
| 127 | - $eventSource->send('success', (string)$l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 127 | + $eventSource->send('success', (string) $l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | 130 | $feedBack = new FeedBackHandler($eventSource, $l); |
@@ -136,76 +136,76 @@ discard block |
||
| 136 | 136 | $dispatcher->addListener('\OC\Repair::warning', [$feedBack, 'handleRepairFeedback']); |
| 137 | 137 | $dispatcher->addListener('\OC\Repair::error', [$feedBack, 'handleRepairFeedback']); |
| 138 | 138 | |
| 139 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) { |
|
| 140 | - $eventSource->send('success', (string)$l->t('Turned on maintenance mode')); |
|
| 139 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use ($eventSource, $l) { |
|
| 140 | + $eventSource->send('success', (string) $l->t('Turned on maintenance mode')); |
|
| 141 | 141 | }); |
| 142 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) { |
|
| 143 | - $eventSource->send('success', (string)$l->t('Turned off maintenance mode')); |
|
| 142 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use ($eventSource, $l) { |
|
| 143 | + $eventSource->send('success', (string) $l->t('Turned off maintenance mode')); |
|
| 144 | 144 | }); |
| 145 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) { |
|
| 146 | - $eventSource->send('success', (string)$l->t('Maintenance mode is kept active')); |
|
| 145 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use ($eventSource, $l) { |
|
| 146 | + $eventSource->send('success', (string) $l->t('Maintenance mode is kept active')); |
|
| 147 | 147 | }); |
| 148 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($eventSource, $l) { |
|
| 149 | - $eventSource->send('success', (string)$l->t('Updating database schema')); |
|
| 148 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use($eventSource, $l) { |
|
| 149 | + $eventSource->send('success', (string) $l->t('Updating database schema')); |
|
| 150 | 150 | }); |
| 151 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) { |
|
| 152 | - $eventSource->send('success', (string)$l->t('Updated database')); |
|
| 151 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use ($eventSource, $l) { |
|
| 152 | + $eventSource->send('success', (string) $l->t('Updated database')); |
|
| 153 | 153 | }); |
| 154 | - $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($eventSource, $l) { |
|
| 155 | - $eventSource->send('success', (string)$l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)')); |
|
| 154 | + $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function() use($eventSource, $l) { |
|
| 155 | + $eventSource->send('success', (string) $l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)')); |
|
| 156 | 156 | }); |
| 157 | - $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use ($eventSource, $l) { |
|
| 158 | - $eventSource->send('success', (string)$l->t('Checked database schema update')); |
|
| 157 | + $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function() use ($eventSource, $l) { |
|
| 158 | + $eventSource->send('success', (string) $l->t('Checked database schema update')); |
|
| 159 | 159 | }); |
| 160 | - $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) { |
|
| 161 | - $eventSource->send('success', (string)$l->t('Checking updates of apps')); |
|
| 160 | + $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function() use ($eventSource, $l) { |
|
| 161 | + $eventSource->send('success', (string) $l->t('Checking updates of apps')); |
|
| 162 | 162 | }); |
| 163 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) { |
|
| 164 | - $eventSource->send('success', (string)$l->t('Checking for update of app "%s" in appstore', [$app])); |
|
| 163 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use ($eventSource, $l) { |
|
| 164 | + $eventSource->send('success', (string) $l->t('Checking for update of app "%s" in appstore', [$app])); |
|
| 165 | 165 | }); |
| 166 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) { |
|
| 167 | - $eventSource->send('success', (string)$l->t('Update app "%s" from appstore', [$app])); |
|
| 166 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use ($eventSource, $l) { |
|
| 167 | + $eventSource->send('success', (string) $l->t('Update app "%s" from appstore', [$app])); |
|
| 168 | 168 | }); |
| 169 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) { |
|
| 170 | - $eventSource->send('success', (string)$l->t('Checked for update of app "%s" in appstore', [$app])); |
|
| 169 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use ($eventSource, $l) { |
|
| 170 | + $eventSource->send('success', (string) $l->t('Checked for update of app "%s" in appstore', [$app])); |
|
| 171 | 171 | }); |
| 172 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) { |
|
| 173 | - $eventSource->send('success', (string)$l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app])); |
|
| 172 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($eventSource, $l) { |
|
| 173 | + $eventSource->send('success', (string) $l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app])); |
|
| 174 | 174 | }); |
| 175 | - $updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($eventSource, $l) { |
|
| 176 | - $eventSource->send('success', (string)$l->t('Checked database schema update for apps')); |
|
| 175 | + $updater->listen('\OC\Updater', 'appUpgradeCheck', function() use ($eventSource, $l) { |
|
| 176 | + $eventSource->send('success', (string) $l->t('Checked database schema update for apps')); |
|
| 177 | 177 | }); |
| 178 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) { |
|
| 179 | - $eventSource->send('success', (string)$l->t('Updated "%s" to %s', array($app, $version))); |
|
| 178 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($eventSource, $l) { |
|
| 179 | + $eventSource->send('success', (string) $l->t('Updated "%s" to %s', array($app, $version))); |
|
| 180 | 180 | }); |
| 181 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) { |
|
| 182 | - $incompatibleApps[]= $app; |
|
| 181 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use (&$incompatibleApps) { |
|
| 182 | + $incompatibleApps[] = $app; |
|
| 183 | 183 | }); |
| 184 | - $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use (&$disabledThirdPartyApps) { |
|
| 185 | - $disabledThirdPartyApps[]= $app; |
|
| 184 | + $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function($app) use (&$disabledThirdPartyApps) { |
|
| 185 | + $disabledThirdPartyApps[] = $app; |
|
| 186 | 186 | }); |
| 187 | - $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config) { |
|
| 187 | + $updater->listen('\OC\Updater', 'failure', function($message) use ($eventSource, $config) { |
|
| 188 | 188 | $eventSource->send('failure', $message); |
| 189 | 189 | $eventSource->close(); |
| 190 | 190 | $config->setSystemValue('maintenance', false); |
| 191 | 191 | }); |
| 192 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 193 | - $eventSource->send('success', (string)$l->t('Set log level to debug')); |
|
| 192 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 193 | + $eventSource->send('success', (string) $l->t('Set log level to debug')); |
|
| 194 | 194 | }); |
| 195 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 196 | - $eventSource->send('success', (string)$l->t('Reset log level')); |
|
| 195 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 196 | + $eventSource->send('success', (string) $l->t('Reset log level')); |
|
| 197 | 197 | }); |
| 198 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($eventSource, $l) { |
|
| 199 | - $eventSource->send('success', (string)$l->t('Starting code integrity check')); |
|
| 198 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use($eventSource, $l) { |
|
| 199 | + $eventSource->send('success', (string) $l->t('Starting code integrity check')); |
|
| 200 | 200 | }); |
| 201 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($eventSource, $l) { |
|
| 202 | - $eventSource->send('success', (string)$l->t('Finished code integrity check')); |
|
| 201 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use($eventSource, $l) { |
|
| 202 | + $eventSource->send('success', (string) $l->t('Finished code integrity check')); |
|
| 203 | 203 | }); |
| 204 | 204 | |
| 205 | 205 | try { |
| 206 | 206 | $updater->upgrade(); |
| 207 | 207 | } catch (\Exception $e) { |
| 208 | - $eventSource->send('failure', get_class($e) . ': ' . $e->getMessage()); |
|
| 208 | + $eventSource->send('failure', get_class($e).': '.$e->getMessage()); |
|
| 209 | 209 | $eventSource->close(); |
| 210 | 210 | exit(); |
| 211 | 211 | } |
@@ -220,10 +220,10 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | if (!empty($disabledApps)) { |
| 222 | 222 | $eventSource->send('notice', |
| 223 | - (string)$l->t('Following apps have been disabled: %s', implode(', ', $disabledApps))); |
|
| 223 | + (string) $l->t('Following apps have been disabled: %s', implode(', ', $disabledApps))); |
|
| 224 | 224 | } |
| 225 | 225 | } else { |
| 226 | - $eventSource->send('notice', (string)$l->t('Already up to date')); |
|
| 226 | + $eventSource->send('notice', (string) $l->t('Already up to date')); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | $eventSource->send('done', ''); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 89 | 89 | |
| 90 | - if(\OC::checkUpgrade(false)) { |
|
| 90 | + if (\OC::checkUpgrade(false)) { |
|
| 91 | 91 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 92 | 92 | // Prepend each line with a little timestamp |
| 93 | 93 | $timestampFormatter = new TimestampFormatter($this->config, $output->getFormatter()); |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | if ($event instanceof GenericEvent) { |
| 112 | 112 | $message = $event->getSubject(); |
| 113 | 113 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 114 | - $output->writeln(' Checking table ' . $message); |
|
| 114 | + $output->writeln(' Checking table '.$message); |
|
| 115 | 115 | } else { |
| 116 | 116 | if (strlen($message) > 60) { |
| 117 | - $message = substr($message, 0, 57) . '...'; |
|
| 117 | + $message = substr($message, 0, 57).'...'; |
|
| 118 | 118 | } |
| 119 | 119 | $progress->setMessage($message); |
| 120 | 120 | if ($event[0] === 1) { |
@@ -155,20 +155,20 @@ discard block |
||
| 155 | 155 | $output->writeln(''); |
| 156 | 156 | break; |
| 157 | 157 | case '\OC\Repair::step': |
| 158 | - if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 159 | - $output->writeln('<info>Repair step: ' . $event->getArgument(0) . '</info>'); |
|
| 158 | + if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 159 | + $output->writeln('<info>Repair step: '.$event->getArgument(0).'</info>'); |
|
| 160 | 160 | } |
| 161 | 161 | break; |
| 162 | 162 | case '\OC\Repair::info': |
| 163 | - if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 164 | - $output->writeln('<info>Repair info: ' . $event->getArgument(0) . '</info>'); |
|
| 163 | + if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 164 | + $output->writeln('<info>Repair info: '.$event->getArgument(0).'</info>'); |
|
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | case '\OC\Repair::warning': |
| 168 | - $output->writeln('<error>Repair warning: ' . $event->getArgument(0) . '</error>'); |
|
| 168 | + $output->writeln('<error>Repair warning: '.$event->getArgument(0).'</error>'); |
|
| 169 | 169 | break; |
| 170 | 170 | case '\OC\Repair::error': |
| 171 | - $output->writeln('<error>Repair error: ' . $event->getArgument(0) . '</error>'); |
|
| 171 | + $output->writeln('<error>Repair error: '.$event->getArgument(0).'</error>'); |
|
| 172 | 172 | break; |
| 173 | 173 | } |
| 174 | 174 | }; |
@@ -184,17 +184,17 @@ discard block |
||
| 184 | 184 | $dispatcher->addListener('\OC\Repair::error', $repairListener); |
| 185 | 185 | |
| 186 | 186 | |
| 187 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) { |
|
| 187 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use($output) { |
|
| 188 | 188 | $output->writeln('<info>Turned on maintenance mode</info>'); |
| 189 | 189 | }); |
| 190 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use($output) { |
|
| 190 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use($output) { |
|
| 191 | 191 | $output->writeln('<info>Turned off maintenance mode</info>'); |
| 192 | 192 | }); |
| 193 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use($output) { |
|
| 193 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use($output) { |
|
| 194 | 194 | $output->writeln('<info>Maintenance mode is kept active</info>'); |
| 195 | 195 | }); |
| 196 | 196 | $updater->listen('\OC\Updater', 'updateEnd', |
| 197 | - function ($success) use($output, $self) { |
|
| 197 | + function($success) use($output, $self) { |
|
| 198 | 198 | if ($success) { |
| 199 | 199 | $message = "<info>Update successful</info>"; |
| 200 | 200 | } else { |
@@ -202,61 +202,61 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | $output->writeln($message); |
| 204 | 204 | }); |
| 205 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($output) { |
|
| 205 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use($output) { |
|
| 206 | 206 | $output->writeln('<info>Updating database schema</info>'); |
| 207 | 207 | }); |
| 208 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) { |
|
| 208 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use($output) { |
|
| 209 | 209 | $output->writeln('<info>Updated database</info>'); |
| 210 | 210 | }); |
| 211 | - $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($output) { |
|
| 211 | + $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function() use($output) { |
|
| 212 | 212 | $output->writeln('<info>Checking whether the database schema can be updated (this can take a long time depending on the database size)</info>'); |
| 213 | 213 | }); |
| 214 | - $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($output) { |
|
| 214 | + $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function() use($output) { |
|
| 215 | 215 | $output->writeln('<info>Checked database schema update</info>'); |
| 216 | 216 | }); |
| 217 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) { |
|
| 218 | - $output->writeln('<comment>Disabled incompatible app: ' . $app . '</comment>'); |
|
| 217 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use($output) { |
|
| 218 | + $output->writeln('<comment>Disabled incompatible app: '.$app.'</comment>'); |
|
| 219 | 219 | }); |
| 220 | - $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($output) { |
|
| 221 | - $output->writeln('<comment>Disabled 3rd-party app: ' . $app . '</comment>'); |
|
| 220 | + $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function($app) use ($output) { |
|
| 221 | + $output->writeln('<comment>Disabled 3rd-party app: '.$app.'</comment>'); |
|
| 222 | 222 | }); |
| 223 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($output) { |
|
| 224 | - $output->writeln('<info>Checking for update of app ' . $app . ' in appstore</info>'); |
|
| 223 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use($output) { |
|
| 224 | + $output->writeln('<info>Checking for update of app '.$app.' in appstore</info>'); |
|
| 225 | 225 | }); |
| 226 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($output) { |
|
| 227 | - $output->writeln('<info>Update app ' . $app . ' from appstore</info>'); |
|
| 226 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use($output) { |
|
| 227 | + $output->writeln('<info>Update app '.$app.' from appstore</info>'); |
|
| 228 | 228 | }); |
| 229 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($output) { |
|
| 230 | - $output->writeln('<info>Checked for update of app "' . $app . '" in appstore </info>'); |
|
| 229 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use($output) { |
|
| 230 | + $output->writeln('<info>Checked for update of app "'.$app.'" in appstore </info>'); |
|
| 231 | 231 | }); |
| 232 | - $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($output) { |
|
| 232 | + $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function() use ($output) { |
|
| 233 | 233 | $output->writeln('<info>Checking updates of apps</info>'); |
| 234 | 234 | }); |
| 235 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($output) { |
|
| 235 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($output) { |
|
| 236 | 236 | $output->writeln("<info>Checking whether the database schema for <$app> can be updated (this can take a long time depending on the database size)</info>"); |
| 237 | 237 | }); |
| 238 | - $updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($output) { |
|
| 238 | + $updater->listen('\OC\Updater', 'appUpgradeCheck', function() use ($output) { |
|
| 239 | 239 | $output->writeln('<info>Checked database schema update for apps</info>'); |
| 240 | 240 | }); |
| 241 | - $updater->listen('\OC\Updater', 'appUpgradeStarted', function ($app, $version) use ($output) { |
|
| 241 | + $updater->listen('\OC\Updater', 'appUpgradeStarted', function($app, $version) use ($output) { |
|
| 242 | 242 | $output->writeln("<info>Updating <$app> ...</info>"); |
| 243 | 243 | }); |
| 244 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) { |
|
| 244 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($output) { |
|
| 245 | 245 | $output->writeln("<info>Updated <$app> to $version</info>"); |
| 246 | 246 | }); |
| 247 | - $updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) { |
|
| 247 | + $updater->listen('\OC\Updater', 'failure', function($message) use($output, $self) { |
|
| 248 | 248 | $output->writeln("<error>$message</error>"); |
| 249 | 249 | }); |
| 250 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($output) { |
|
| 250 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use($output) { |
|
| 251 | 251 | $output->writeln("<info>Set log level to debug</info>"); |
| 252 | 252 | }); |
| 253 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($output) { |
|
| 253 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use($output) { |
|
| 254 | 254 | $output->writeln("<info>Reset log level</info>"); |
| 255 | 255 | }); |
| 256 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($output) { |
|
| 256 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use($output) { |
|
| 257 | 257 | $output->writeln("<info>Starting code integrity check...</info>"); |
| 258 | 258 | }); |
| 259 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($output) { |
|
| 259 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use($output) { |
|
| 260 | 260 | $output->writeln("<info>Finished code integrity check</info>"); |
| 261 | 261 | }); |
| 262 | 262 | |
@@ -264,12 +264,12 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | $this->postUpgradeCheck($input, $output); |
| 266 | 266 | |
| 267 | - if(!$success) { |
|
| 267 | + if (!$success) { |
|
| 268 | 268 | return self::ERROR_FAILURE; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | return self::ERROR_SUCCESS; |
| 272 | - } else if($this->config->getSystemValue('maintenance', false)) { |
|
| 272 | + } else if ($this->config->getSystemValue('maintenance', false)) { |
|
| 273 | 273 | //Possible scenario: Nextcloud core is updated but an app failed |
| 274 | 274 | $output->writeln('<warning>Nextcloud is in maintenance mode</warning>'); |
| 275 | 275 | $output->write('<comment>Maybe an upgrade is already in process. Please check the ' |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | $trustedDomains = $this->config->getSystemValue('trusted_domains', array()); |
| 295 | 295 | if (empty($trustedDomains)) { |
| 296 | 296 | $output->write( |
| 297 | - '<warning>The setting "trusted_domains" could not be ' . |
|
| 298 | - 'set automatically by the upgrade script, ' . |
|
| 297 | + '<warning>The setting "trusted_domains" could not be '. |
|
| 298 | + 'set automatically by the upgrade script, '. |
|
| 299 | 299 | 'please set it manually</warning>' |
| 300 | 300 | ); |
| 301 | 301 | } |