mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 23:27:17 +02:00
SQLite: Fix non-PDO driver after 99163fe
This commit is contained in:
@@ -8,8 +8,8 @@ if (isset($_GET["sqlite"])) {
|
|||||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||||
|
|
||||||
class SqliteDb {
|
class SqliteDb {
|
||||||
public $extension = "SQLite3", $server_info, $affected_rows, $errno, $error;
|
public $extension = "SQLite3", $flavor = '', $server_info, $affected_rows, $errno, $error;
|
||||||
private $link;
|
private $link, $result;
|
||||||
|
|
||||||
function __construct($filename) {
|
function __construct($filename) {
|
||||||
$this->link = new \SQLite3($filename);
|
$this->link = new \SQLite3($filename);
|
||||||
@@ -38,10 +38,19 @@ if (isset($_GET["sqlite"])) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function multi_query($query) {
|
||||||
|
return $this->result = $this->query($query);
|
||||||
|
}
|
||||||
|
|
||||||
function store_result() {
|
function store_result() {
|
||||||
return $this->result;
|
return $this->result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function next_result() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function result($query, $field = 0) {
|
function result($query, $field = 0) {
|
||||||
$result = $this->query($query);
|
$result = $this->query($query);
|
||||||
if (!is_object($result)) {
|
if (!is_object($result)) {
|
||||||
@@ -100,8 +109,6 @@ if (isset($_GET["sqlite"])) {
|
|||||||
|
|
||||||
if (class_exists('Adminer\SqliteDb')) {
|
if (class_exists('Adminer\SqliteDb')) {
|
||||||
class Db extends SqliteDb {
|
class Db extends SqliteDb {
|
||||||
public $flavor = '';
|
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
parent::__construct(":memory:");
|
parent::__construct(":memory:");
|
||||||
$this->query("PRAGMA foreign_keys = 1");
|
$this->query("PRAGMA foreign_keys = 1");
|
||||||
|
Reference in New Issue
Block a user