diff options
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-x | lib/private/util.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index d384eda5f7f..225cd64dbb3 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -377,7 +377,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); } @@ -1404,4 +1404,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; + } + } } |