summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-05-26 13:32:06 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-05-26 13:32:06 +0200
commit94f7b3e25ca830b62cfe6221fed2ba03ea3ab75f (patch)
tree5dbac48dca5665ca3ffd50e8904fb9bfaa027350
parent3bc312ef9a5936b13492194565d5fddc1f920e49 (diff)
parent6eb8bdb5c9439e9048099a51594140d88556461e (diff)
downloadnextcloud-server-94f7b3e25ca830b62cfe6221fed2ba03ea3ab75f.tar.gz
nextcloud-server-94f7b3e25ca830b62cfe6221fed2ba03ea3ab75f.zip
Merge pull request #16497 from owncloud/stable8-backport-16473
Skip disable3rdParty Apps
-rw-r--r--core/command/upgrade.php14
-rw-r--r--lib/private/updater.php21
2 files changed, 30 insertions, 5 deletions
diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index 8c3fbacb3f4..a4a5be21096 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -53,6 +53,12 @@ class Upgrade extends Command {
null,
InputOption::VALUE_NONE,
'only runs the database schema migration simulation, do not actually update'
+ )
+ ->addOption(
+ '--no-app-disable',
+ null,
+ InputOption::VALUE_NONE,
+ 'skips the disable of third party apps'
);
}
@@ -66,6 +72,7 @@ class Upgrade extends Command {
$simulateStepEnabled = true;
$updateStepEnabled = true;
+ $skip3rdPartyAppsDisable = false;
if ($input->getOption('skip-migration-test')) {
$simulateStepEnabled = false;
@@ -73,6 +80,9 @@ class Upgrade extends Command {
if ($input->getOption('dry-run')) {
$updateStepEnabled = false;
}
+ if ($input->getOption('no-app-disable')) {
+ $skip3rdPartyAppsDisable = true;
+ }
if (!$simulateStepEnabled && !$updateStepEnabled) {
$output->writeln(
@@ -89,6 +99,7 @@ class Upgrade extends Command {
$updater->setSimulateStepEnabled($simulateStepEnabled);
$updater->setUpdateStepEnabled($updateStepEnabled);
+ $updater->setSkip3rdPartyAppsDisable($skip3rdPartyAppsDisable);
$updater->listen('\OC\Updater', 'maintenanceStart', function () use($output) {
$output->writeln('<info>Turned on maintenance mode</info>');
@@ -110,7 +121,7 @@ class Upgrade extends Command {
$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) {
$output->writeln('<info>Disabled incompatible app: ' . $app . '</info>');
});
- $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use($output) {
+ $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($output) {
$output->writeln('<info>Disabled 3rd-party app: ' . $app . '</info>');
});
$updater->listen('\OC\Updater', 'repairWarning', function ($app) use($output) {
@@ -125,7 +136,6 @@ class Upgrade extends Command {
$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) {
$output->writeln("<info>Updated <$app> to $version</info>");
});
-
$updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) {
$output->writeln("<error>$message</error>");
$self->upgradeFailed = true;
diff --git a/lib/private/updater.php b/lib/private/updater.php
index 08731c731e4..d28060c100a 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -39,6 +39,9 @@ class Updater extends BasicEmitter {
/** @var bool */
private $updateStepEnabled;
+ /** @var bool */
+ private $skip3rdPartyAppsDisable;
+
/**
* @param HTTPHelper $httpHelper
* @param IConfig $config
@@ -74,6 +77,16 @@ class Updater extends BasicEmitter {
}
/**
+ * Sets whether the update disables 3rd party apps.
+ * This can be set to true to skip the disable.
+ *
+ * @param bool $flag false to not disable, true otherwise
+ */
+ public function setSkip3rdPartyAppsDisable($flag) {
+ $this->skip3rdPartyAppsDisable = $flag;
+ }
+
+ /**
* Check if a new version is available
*
* @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
@@ -376,9 +389,11 @@ class Updater extends BasicEmitter {
continue;
}
- // disable any other 3rd party apps
- \OC_App::disable($app);
- $this->emit('\OC\Updater', 'thirdPartyAppDisabled', array($app));
+ // disable any other 3rd party apps if not overriden
+ if(!$this->skip3rdPartyAppsDisable) {
+ \OC_App::disable($app);
+ $this->emit('\OC\Updater', 'thirdPartyAppDisabled', array($app));
+ };
}
}