summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-10 18:01:07 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-18 11:10:07 +0200
commit799205488cf82312586f99185e13df6015caa2ff (patch)
treed8c6172b48d8cdabb16ef8b535a21c96b1ebc739 /lib/private/util.php
parentbaf46c74cda834bbdb4ecf4669587b92b56fe9a9 (diff)
downloadnextcloud-server-799205488cf82312586f99185e13df6015caa2ff.tar.gz
nextcloud-server-799205488cf82312586f99185e13df6015caa2ff.zip
Prevent loadApps on upgrade
Moved OC::needUpgrade() to OCP\Util::needUpgrade() to make it accessible form the router. Moved maintenance + upgrade check to the router.
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-xlib/private/util.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index dfdddd0e3ab..94005daef61 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -329,7 +329,7 @@ class OC_Util {
$errors = array();
$CONFIG_DATADIRECTORY = OC_Config::getValue('datadirectory', OC::$SERVERROOT . '/data');
- if (!\OC::needUpgrade() && OC_Config::getValue('installed', false)) {
+ if (!self::needUpgrade() && OC_Config::getValue('installed', false)) {
// this check needs to be done every time
$errors = self::checkDataDirectoryValidity($CONFIG_DATADIRECTORY);
}
@@ -1356,4 +1356,19 @@ class OC_Util {
}
return true;
}
+
+ /**
+ * Check whether the instance needs to preform an upgrade
+ *
+ * @return bool
+ */
+ public static function needUpgrade() {
+ if (OC_Config::getValue('installed', false)) {
+ $installedVersion = OC_Config::getValue('version', '0.0.0');
+ $currentVersion = implode('.', OC_Util::getVersion());
+ return version_compare($currentVersion, $installedVersion, '>');
+ } else {
+ return false;
+ }
+ }
}