Commit f5b0ca26 authored by nveid's avatar nveid
Browse files

Converted all mysql_ calls to OO based mysqli calls.

Also removed the calls to the db closeConn calls in favor of
destryong the connections on the class __destruct() 's..

Since firebird db had a closeConn as well, changed its __destruct
to calls its own personal closeConn which otherwise left unmodified.

Refs: 1722
parent 60c54cfa
......@@ -78,7 +78,6 @@ class app {
public function __destruct() {
session_write_close();
if(isset($this->db)) $this->db->closeConn();
}
public function uses($classes) {
......@@ -243,4 +242,4 @@ class app {
//* possible future = new app($conf);
$app = new app();
?>
\ No newline at end of file
?>
......@@ -45,7 +45,7 @@ class db {
var $transID;
// constructor
function db()
function __construct()
{
global $conf;
......@@ -55,6 +55,9 @@ class db {
$this->dbPass = $conf["db_password"];
$this->connect();
}
function __destruct() {
$this->closeConn();
}
// error handler
function updateError($location)
......@@ -377,4 +380,4 @@ class db {
}
?>
\ No newline at end of file
?>
This diff is collapsed.
......@@ -40,11 +40,6 @@ class app {
if($conf['start_db'] == true) {
$this->load('db_'.$conf['db_type']);
$this->db = new db;
if($this->db->linkId) $this->db->closeConn();
$this->db->dbHost = $conf['db_host'];
$this->db->dbName = $conf['db_database'];
$this->db->dbUser = $conf['db_user'];
$this->db->dbPass = $conf['db_password'];
/*
Initialize the connection to the master DB,
......@@ -53,11 +48,6 @@ class app {
if($conf['dbmaster_host'] != '' && $conf['dbmaster_host'] != $conf['db_host']) {
$this->dbmaster = new db;
if($this->dbmaster->linkId) $this->dbmaster->closeConn();
$this->dbmaster->dbHost = $conf['dbmaster_host'];
$this->dbmaster->dbName = $conf['dbmaster_database'];
$this->dbmaster->dbUser = $conf['dbmaster_user'];
$this->dbmaster->dbPass = $conf['dbmaster_password'];
} else {
$this->dbmaster = $this->db;
}
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment