]> git.wh0rd.org - tt-rss.git/blame - classes/Db/Abstract.php
Merge pull request #46 from mbirth/master
[tt-rss.git] / classes / Db / Abstract.php
CommitLineData
65d0cc64
MB
1<?php
2
3abstract class Db_Abstract implements Db_Interface
4{
5 private $dbconn;
6 protected static $instance;
7
8 private function __construct() { }
9
10 public static function instance()
11 {
12 if (is_null(static::$instance)) {
13 static::$instance = new static();
14 }
15
16 return static::$instance;
17 }
18
19 public function connect($host, $user, $pass, $db) { }
20
21 public function getLink()
22 {
23 return $this->dbconn;
24 }
25
26 public function init() { }
27
28 public function escape_string($s, $strip_tags = true) { }
29
30 public function query($query, $die_on_error = true) { }
31
32 public function fetch_assoc($result) { }
33
34 public function num_rows($result) { }
35
36 public function fetch_result($result, $row, $param) { }
37
38 public function unescape_string($str)
39 {
40 $tmp = str_replace("\\\"", "\"", $str);
41 $tmp = str_replace("\\'", "'", $tmp);
42 return $tmp;
43 }
44
45 public function close() { }
46
47 public function affected_rows($result) { }
48
49 public function last_error() { }
50
51 public function quote($str)
52 {
53 return("'$str'");
54 }
55
56}