summaryrefslogtreecommitdiffstats
path: root/lib/private/setup/sqlite.php
blob: fd4df792d622c0cdcb05775dab94d307313817f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
	}
}