summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-05 21:14:35 +0300
committerAndrew Dolgov <[email protected]>2021-03-05 21:14:35 +0300
commit2b8b845abe7c13ecbb266613910484310cffe8e1 (patch)
tree90bd2e93737c2aad17cfb09496cc57cf3f9968cd /db.php
parentb2341679d53b227fc90fba34c3a7e6453e3cad6e (diff)
* use ORM for trivial queries
* environment-based configuration * useradm.php -> update.php with new options * support for schema migrations * various fixes
Diffstat (limited to 'db.php')
-rw-r--r--db.php26
1 files changed, 0 insertions, 26 deletions
diff --git a/db.php b/db.php
deleted file mode 100644
index 6e28a91..0000000
--- a/db.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-class Db {
- private static $instance;
- private $dbh;
-
- private function __construct() {
- try {
- $this->dbh = new PDO('sqlite:' . SCRATCH_DB);
- } catch (Exception $e) {
- die("Unable to initialize database driver (SQLite): $e");
- }
- //$this->dbh->busyTimeout(30*1000);
- $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $this->dbh->query('PRAGMA journal_mode = wal;');
- }
-
- public static function get() {
- if (self::$instance == null)
- self::$instance = new self();
-
- return self::$instance->dbh;
- }
-
-};
-
-?>