aboutsummaryrefslogtreecommitdiffstats
path: root/lib/setup
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-04-03 08:31:47 +0200
committerBart Visscher <bartv@thisnet.nl>2013-06-29 21:07:11 +0200
commit2faccaee0d22efa6b23586b65f222e8cc5404366 (patch)
tree3831ba76b2a53253d9a755bd68e9b33bf2763543 /lib/setup
parente232907698cc1184136a14917548078e781a278a (diff)
downloadnextcloud-server-2faccaee0d22efa6b23586b65f222e8cc5404366.tar.gz
nextcloud-server-2faccaee0d22efa6b23586b65f222e8cc5404366.zip
Change database creation to use array to select db setup class
Diffstat (limited to 'lib/setup')
-rw-r--r--lib/setup/sqlite.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/setup/sqlite.php b/lib/setup/sqlite.php
new file mode 100644
index 00000000000..b1785ce1b0b
--- /dev/null
+++ b/lib/setup/sqlite.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace OC\Setup;
+
+class Sqlite extends AbstractDatabase {
+ 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('db_structure.xml');
+ }
+}