diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-24 14:51:55 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-24 14:51:55 +0300 |
commit | 80cafe29a8e3a9624887632bc2b24f33c6b03ef8 (patch) | |
tree | 05b85b6b8d5bcc99eb7e6766f0aeef082726626a /lib/private/updater.php | |
parent | fe7e7677e91a6c66f600f303ad3dc36a34c0d424 (diff) |
3rd-party apps are only disabled in case core is upgraded
Diffstat (limited to 'lib/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index 0853696fe24..5b505d7dedb 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -358,6 +358,7 @@ class Updater extends BasicEmitter { * party apps installed. */ private function checkAppsRequirements() { + $isCoreUpgrade = $this->isCodeUpgrade(); $apps = OC_App::getEnabledApps(); $version = OC_Util::getVersion(); foreach ($apps as $app) { @@ -367,6 +368,10 @@ class Updater extends BasicEmitter { OC_App::disable($app); $this->emit('\OC\Updater', 'incompatibleAppDisabled', array($app)); } + // no need to disable any app in case this is a non-core upgrade + if (!$isCoreUpgrade) { + continue; + } // shipped apps will remain enabled if (OC_App::isShipped($app)) { continue; @@ -381,5 +386,14 @@ class Updater extends BasicEmitter { $this->emit('\OC\Updater', 'thirdPartyAppDisabled', array($app)); } } + + private function isCodeUpgrade() { + $installedVersion = $this->config->getSystemValue('version', '0.0.0'); + $currentVersion = implode('.', OC_Util::getVersion()); + if (version_compare($currentVersion, $installedVersion, '>')) { + return true; + } + return false; + } } |