sqlite.php 616 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace OC\Setup;
  3. class Sqlite extends AbstractDatabase {
  4. public $dbprettyname = 'Sqlite';
  5. public function validate($config) {
  6. return array();
  7. }
  8. public function initialize($config) {
  9. }
  10. public function setupDatabase($username) {
  11. $datadir = \OC_Config::getValue('datadirectory');
  12. //delete the old sqlite database first, might cause infinte loops otherwise
  13. if(file_exists("$datadir/owncloud.db")) {
  14. unlink("$datadir/owncloud.db");
  15. }
  16. //in case of sqlite, we can always fill the database
  17. error_log("creating sqlite db");
  18. \OC_DB::createDbFromStructure($this->dbDefinitionFile);
  19. }
  20. }