Browse Source

upgrade driver to PHP 8

pull/8/head
d47081 2 years ago
parent
commit
76ed2d5a04
  1. 12
      library/sqlite.php

12
library/sqlite.php

@ -2,13 +2,13 @@
class SQLite { class SQLite {
private $_db; private PDO $_db;
public function __construct($database, $username, $password) { public function __construct(string $database, string $username, string $password) {
try { try {
$this->_db = new PDO('sqlite:' . $database, $username, $password, [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8']); $this->_db = new PDO('sqlite:' . $database, $username, $password);
$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->_db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); $this->_db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$this->_db->setAttribute(PDO::ATTR_TIMEOUT, 600); $this->_db->setAttribute(PDO::ATTR_TIMEOUT, 600);
@ -66,7 +66,7 @@ class SQLite {
} }
} }
public function getNamespaceValueByNS($ns) { public function getNamespaceValueByNS(string $ns) {
try { try {
@ -96,7 +96,7 @@ class SQLite {
} }
} }
public function getNamespaceHashByTX($txid) { public function getNamespaceHashByTX(string $txid) {
try { try {
@ -118,7 +118,7 @@ class SQLite {
} }
} }
public function getData($namehash = false, $txid = false, $search = false, $start = 0, $limit = 10) { public function getData(bool $namehash = false, bool $txid = false, bool $search = false, int $start = 0, int $limit = 10) {
try { try {

Loading…
Cancel
Save