summaryrefslogtreecommitdiffstats
path: root/lib/private/setup/sqlite.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/setup/sqlite.php')
-rw-r--r--lib/private/setup/sqlite.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/private/setup/sqlite.php b/lib/private/setup/sqlite.php
new file mode 100644
index 00000000000..fd4df792d62
--- /dev/null
+++ b/lib/private/setup/sqlite.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace OC\Setup;
+
+class Sqlite extends AbstractDatabase {
+ public $dbprettyname = 'Sqlite';
+
+ public function validate($config) {
+ return array();
+ }
+
+ public function initialize($config) {
+ }
+
+ public function setupDatabase($username) {
+ $datadir = \OC_Config::getValue('datadirectory');
+
+ //delete the old sqlite database first, might cause infinte loops otherwise
+ if(file_exists("$datadir/owncloud.db")) {
+ unlink("$datadir/owncloud.db");
+ }
+ //in case of sqlite, we can always fill the database
+ error_log("creating sqlite db");
+ \OC_DB::createDbFromStructure($this->dbDefinitionFile);
+ }
+}