summaryrefslogtreecommitdiff
path: root/classes/Db/Abstract.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-15 03:09:22 -0700
committerAndrew Dolgov <[email protected]>2013-03-15 03:09:22 -0700
commit07be89952d9e0b16eebd1b1a6a8dc8f7f41fcf3b (patch)
tree840b4a3237f4dae0a9ae988d7b0691b0fcd38c2d /classes/Db/Abstract.php
parent7d272e5c04141529309fe2924d0aac93f17b56ea (diff)
parent65d0cc64a2ca1ce259fbba501b13deaf1870e540 (diff)
Merge pull request #46 from mbirth/master
Core db features in separate classes for Pgsql and Mysql
Diffstat (limited to 'classes/Db/Abstract.php')
-rw-r--r--classes/Db/Abstract.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/classes/Db/Abstract.php b/classes/Db/Abstract.php
new file mode 100644
index 000000000..d84701fd7
--- /dev/null
+++ b/classes/Db/Abstract.php
@@ -0,0 +1,56 @@
+<?php
+
+abstract class Db_Abstract implements Db_Interface
+{
+ private $dbconn;
+ protected static $instance;
+
+ private function __construct() { }
+
+ public static function instance()
+ {
+ if (is_null(static::$instance)) {
+ static::$instance = new static();
+ }
+
+ return static::$instance;
+ }
+
+ public function connect($host, $user, $pass, $db) { }
+
+ public function getLink()
+ {
+ return $this->dbconn;
+ }
+
+ public function init() { }
+
+ public function escape_string($s, $strip_tags = true) { }
+
+ public function query($query, $die_on_error = true) { }
+
+ public function fetch_assoc($result) { }
+
+ public function num_rows($result) { }
+
+ public function fetch_result($result, $row, $param) { }
+
+ public function unescape_string($str)
+ {
+ $tmp = str_replace("\\\"", "\"", $str);
+ $tmp = str_replace("\\'", "'", $tmp);
+ return $tmp;
+ }
+
+ public function close() { }
+
+ public function affected_rows($result) { }
+
+ public function last_error() { }
+
+ public function quote($str)
+ {
+ return("'$str'");
+ }
+
+} \ No newline at end of file