summaryrefslogtreecommitdiffstats
path: root/lib/private/app/dependencyanalyzer.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-05 15:28:33 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-11 12:02:12 +0100
commit5a03e0a5cf30f4ad5cecd7a90ad3bc2a004770aa (patch)
treee8429231ef714254ae135b4fb7dc3bb82e89ddfe /lib/private/app/dependencyanalyzer.php
parentee46548f57310b45ce723fd03ec29bfb686f8bc2 (diff)
downloadnextcloud-server-5a03e0a5cf30f4ad5cecd7a90ad3bc2a004770aa.tar.gz
nextcloud-server-5a03e0a5cf30f4ad5cecd7a90ad3bc2a004770aa.zip
adding dependency to owncloud version - with fallback to requiremin and requiremax
Diffstat (limited to 'lib/private/app/dependencyanalyzer.php')
-rw-r--r--lib/private/app/dependencyanalyzer.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/app/dependencyanalyzer.php b/lib/private/app/dependencyanalyzer.php
index 2e838872385..795017e2b37 100644
--- a/lib/private/app/dependencyanalyzer.php
+++ b/lib/private/app/dependencyanalyzer.php
@@ -26,6 +26,8 @@ class DependencyAnalyzer {
/** @var array */
private $dependencies = array();
+ private $appInfo = array();
+
/**
* @param array $app
* @param Platform $platform
@@ -49,6 +51,7 @@ class DependencyAnalyzer {
$this->analyzeCommands();
$this->analyzeLibraries();
$this->analyzeOS();
+ $this->analyzeOC();
return $this->missing;
}
@@ -154,7 +157,31 @@ class DependencyAnalyzer {
}
}
+ private function analyzeOC() {
+ $minVersion = null;
+ if (isset($this->dependencies['owncloud']['@attributes']['min-version'])) {
+ $minVersion = $this->dependencies['owncloud']['@attributes']['min-version'];
+ } elseif (isset($this->appInfo['requiremin'])) {
+ $minVersion = $this->appInfo['requiremin'];
+ }
+ $maxVersion = null;
+ if (isset($this->dependencies['oc']['@attributes']['max-version'])) {
+ $maxVersion = $this->dependencies['oc']['@attributes']['max-version'];
+ } elseif (isset($this->appInfo['requiremax'])) {
+ $maxVersion = $this->appInfo['requiremax'];
+ }
+ if (!is_null($minVersion)) {
+ if (version_compare($this->platform->getOcVersion(), $minVersion, '<')) {
+ $this->addMissing((string)$this->l->t('ownCloud %s or higher is required.', $minVersion));
+ }
+ }
+ if (!is_null($maxVersion)) {
+ if (version_compare($this->platform->getOcVersion(), $maxVersion, '>')) {
+ $this->addMissing((string)$this->l->t('ownCloud with a version lower than %s is required.', $maxVersion));
+ }
+ }
+ }
/**
* @param $element