mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-02-09 05:31:34 +00:00
Merge branch 'pdo-experimental' of git.fakecake.org:tt-rss into pdo-experimental
This commit is contained in:
@@ -57,6 +57,13 @@ class Db implements IDb {
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public static function pdo() {
|
||||
if (self::$instance == null)
|
||||
self::$instance = new self();
|
||||
|
||||
return self::$instance->pdo;
|
||||
}
|
||||
|
||||
static function quote($str){
|
||||
return("'$str'");
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
class Db_Stmt {
|
||||
private $stmt;
|
||||
private $cache;
|
||||
|
||||
function __construct($stmt) {
|
||||
$this->stmt = $stmt;
|
||||
$this->cache = false;
|
||||
}
|
||||
|
||||
function fetch_result($row, $param) {
|
||||
if (!$this->cache) {
|
||||
$this->cache = $this->stmt->fetchAll();
|
||||
}
|
||||
|
||||
if (isset($this->cache[$row])) {
|
||||
return $this->cache[$row][$param];
|
||||
} else {
|
||||
user_error("Unable to jump to row $row", E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function rowCount() {
|
||||
return $this->stmt->rowCount();
|
||||
}
|
||||
|
||||
function fetch() {
|
||||
return $this->stmt->fetch();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user