Browse Source

add support for absolute paths for SCRATCH_DB

dlgoodr 2 years ago
parent
commit
e3613e3244
1 changed files with 1 additions and 1 deletions
  1. 1 1
      db.php

+ 1 - 1
db.php

@@ -4,7 +4,7 @@ class Db {
 	private $dbh;
 
 	private function __construct() {
-		$this->dbh = new SQLite3(__DIR__ . "/" . SCRATCH_DB);
+		$this->dbh = new SQLite3((strpos(SCRATCH_DB,"/") == 0 ? "" : __DIR__ . "/") . SCRATCH_DB);
 		$this->dbh->busyTimeout(30*1000);
 		$this->dbh->exec('PRAGMA journal_mode = wal;');
 	}