2013-04-03 10:31:47 +04:00
|
|
|
<?php
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2013-04-03 10:31:47 +04:00
|
|
|
namespace OC\Setup;
|
|
|
|
|
|
|
|
class Sqlite extends AbstractDatabase {
|
2013-04-03 19:52:18 +04:00
|
|
|
public $dbprettyname = 'Sqlite';
|
|
|
|
|
|
|
|
public function validate($config) {
|
2013-04-11 02:08:53 +04:00
|
|
|
return array();
|
2013-04-03 19:52:18 +04:00
|
|
|
}
|
|
|
|
|
2013-04-03 10:31:47 +04:00
|
|
|
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");
|
2013-06-27 22:19:51 +04:00
|
|
|
\OC_DB::createDbFromStructure($this->dbDefinitionFile);
|
2013-04-03 10:31:47 +04:00
|
|
|
}
|
|
|
|
}
|