diff options
author | Andrew Dolgov <[email protected]> | 2021-03-05 21:14:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-05 21:14:35 +0300 |
commit | 2b8b845abe7c13ecbb266613910484310cffe8e1 (patch) | |
tree | 90bd2e93737c2aad17cfb09496cc57cf3f9968cd /db.php | |
parent | b2341679d53b227fc90fba34c3a7e6453e3cad6e (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.php | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -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; - } - -}; - -?> |