summaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-07-25 16:13:34 +0200
committerJoas Schilling <coding@schilljs.com>2016-07-26 14:40:18 +0200
commit0fcc39cd8ec7ad1ecba62ef16bb7a884fb3e9377 (patch)
tree1980a506f87535237179b4cfe1d101e7ba3b05f7 /lib/private/App
parent352e24e703aae74c9486810e8c3550ae581c93cb (diff)
downloadnextcloud-server-0fcc39cd8ec7ad1ecba62ef16bb7a884fb3e9377.tar.gz
nextcloud-server-0fcc39cd8ec7ad1ecba62ef16bb7a884fb3e9377.zip
Translate the server version for nextcloud
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/DependencyAnalyzer.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php
index 9ccc974e3a6..7adb5d1c574 100644
--- a/lib/private/App/DependencyAnalyzer.php
+++ b/lib/private/App/DependencyAnalyzer.php
@@ -304,18 +304,40 @@ class DependencyAnalyzer {
if (!is_null($minVersion)) {
if ($this->compareSmaller($this->platform->getOcVersion(), $minVersion)) {
- $missing[] = (string)$this->l->t('Server version %s or higher is required.', $minVersion);
+ $missing[] = (string)$this->l->t('Server version %s or higher is required.', $this->toVisibleVersion($minVersion));
}
}
if (!is_null($maxVersion)) {
if ($this->compareBigger($this->platform->getOcVersion(), $maxVersion)) {
- $missing[] = (string)$this->l->t('Server version %s or lower is required.', $maxVersion);
+ $missing[] = (string)$this->l->t('Server version %s or lower is required.', $this->toVisibleVersion($maxVersion));
}
}
return $missing;
}
/**
+ * Map the internal version number to the Nextcloud version
+ *
+ * @param string $version
+ * @return string
+ */
+ protected function toVisibleVersion($version) {
+ switch ($version) {
+ case '9.1':
+ return '10';
+ case '9.2':
+ return '11';
+ default:
+ if (strpos($version, '9.1.') === 0) {
+ $version = '10.0.' . substr($version, 4);
+ } else if (strpos($version, '9.2.') === 0) {
+ $version = '11.0.' . substr($version, 4);
+ }
+ return $version;
+ }
+ }
+
+ /**
* @param $element
* @return mixed
*/