summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-01 23:43:27 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-04 11:40:33 +0100
commitba52c996cf81781d752748986c761667f59691a3 (patch)
treefa735e947671acc94656017afd3369740c437e6a /lib
parentd235a9c128a47876ab36a83ef7f6091db907983c (diff)
downloadnextcloud-server-ba52c996cf81781d752748986c761667f59691a3.tar.gz
nextcloud-server-ba52c996cf81781d752748986c761667f59691a3.zip
adding supported databases
Diffstat (limited to 'lib')
-rw-r--r--lib/private/app/dependencyanalyzer.php16
-rw-r--r--lib/private/app/platform.php16
2 files changed, 32 insertions, 0 deletions
diff --git a/lib/private/app/dependencyanalyzer.php b/lib/private/app/dependencyanalyzer.php
index c76181926e2..7fd181c076c 100644
--- a/lib/private/app/dependencyanalyzer.php
+++ b/lib/private/app/dependencyanalyzer.php
@@ -33,6 +33,7 @@ class DependencyAnalyzer {
*/
public function analyze() {
$this->analysePhpVersion();
+ $this->analyseSupportedDatabases();
return $this->missing;
}
@@ -55,4 +56,19 @@ class DependencyAnalyzer {
}
}
+ private function analyseSupportedDatabases() {
+ if (!array_key_exists('database', $this->dependencies)) {
+ return;
+ }
+
+ $supportedDatabases = $this->dependencies['database'];
+ if (empty($supportedDatabases)) {
+ return;
+ }
+ $currentDatabase = $this->system->getDatabase();
+ if (!in_array($currentDatabase, $supportedDatabases)) {
+ $this->missing[] = (string)$this->l->t('Following databases are supported: %s', join(', ', $supportedDatabases));
+ }
+ }
+
}
diff --git a/lib/private/app/platform.php b/lib/private/app/platform.php
index 292159337a0..39f8a2979f9 100644
--- a/lib/private/app/platform.php
+++ b/lib/private/app/platform.php
@@ -10,8 +10,24 @@
namespace OC\App;
+use OCP\IConfig;
+
class Platform {
+
+ function __construct(IConfig $config) {
+ $this->config = $config;
+ }
+
public function getPhpVersion() {
return phpversion();
}
+
+ public function getDatabase() {
+ $dbType = $this->config->getSystemValue('dbtype', 'sqlite');
+ if ($dbType === 'sqlite3') {
+ $dbType = 'sqlite';
+ }
+
+ return $dbType;
+ }
}