summaryrefslogtreecommitdiff
path: root/db.php
blob: 1dc8ce0113ad85967892ad988ab59c6f4e4998b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
class Db {
	private static $instance;
	private $dbh;

	private function __construct() {
		$this->dbh = new SQLite3(__DIR__ . "/" . SCRATCH_DB);
		$this->dbh->busyTimeout(30*1000);
	}

	public static function get() {
		if (self::$instance == null)
			self::$instance = new self();

		return self::$instance->dbh;
	}

};

?>