2013-04-03 06:31:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace OC\Setup;
|
|
|
|
|
|
|
|
class Sqlite extends AbstractDatabase {
|
2013-04-03 15:52:18 +00:00
|
|
|
public $dbprettyname = 'Sqlite';
|
|
|
|
|
|
|
|
public function validate($config) {
|
2013-04-10 22:08:53 +00:00
|
|
|
return array();
|
2013-04-03 15:52:18 +00:00
|
|
|
}
|
|
|
|
|
2013-04-03 06:31:47 +00: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");
|
|
|
|
\OC_DB::createDbFromStructure('db_structure.xml');
|
|
|
|
}
|
|
|
|
}
|