|
|
@ -13,11 +13,10 @@ class Db implements IDb {
|
|
|
|
$this->adapter = new Db_Pgsql();
|
|
|
|
$this->adapter = new Db_Pgsql();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
user_error("Unknown DB_TYPE: " . DB_TYPE);
|
|
|
|
die("Unknown DB_TYPE: " . DB_TYPE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->link = $this->adapter->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
|
|
|
|
$this->link = $this->adapter->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function __clone() {
|
|
|
|
private function __clone() {
|
|
|
@ -35,10 +34,6 @@ class Db implements IDb {
|
|
|
|
return("'$str'");
|
|
|
|
return("'$str'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function connect($host, $user, $pass, $db, $port) {
|
|
|
|
function connect($host, $user, $pass, $db, $port) {
|
|
|
|
//return $this->adapter->connect($host, $user, $pass, $db, $port);
|
|
|
|
//return $this->adapter->connect($host, $user, $pass, $db, $port);
|
|
|
|
return $this->link;
|
|
|
|
return $this->link;
|
|
|
|