diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index 9e8169fbf58b19a72efbe44628da6bb5da3d9c9f..283695d7bef6deb6bf2b78dd2b85f3534d592c78 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -43,8 +43,6 @@ class db private $_iQueryId; private $_iConnId; - private $_Prefix = ''; // config variable name prefix - private $dbHost = ''; // hostname of the MySQL server private $dbPort = ''; // port of the MySQL server private $dbName = ''; // logical database name on that server @@ -74,18 +72,17 @@ class db */ // constructor - public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL, $port = NULL, $flags = NULL, $confPrefix = '') { + public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL, $port = NULL, $flags = NULL) { global $app, $conf; - if($confPrefix != '') $this->_Prefix = $confPrefix . '_'; - $this->dbHost = $host ? $host : $conf[$this->_Prefix.'db_host']; - $this->dbPort = $port ? $port : $conf[$this->_Prefix.'db_port']; - $this->dbName = $database ? $database : $conf[$this->_Prefix.'db_database']; - $this->dbUser = $user ? $user : $conf[$this->_Prefix.'db_user']; - $this->dbPass = $pass ? $pass : $conf[$this->_Prefix.'db_password']; - $this->dbCharset = $conf[$this->_Prefix.'db_charset']; - $this->dbNewLink = $conf[$this->_Prefix.'db_new_link']; - $this->dbClientFlags = $flags ? $flags : $conf[$this->_Prefix.'db_client_flags']; + $this->dbHost = $host ? $host : $conf['db_host']; + $this->dbPort = $port ? $port : $conf['db_port']; + $this->dbName = $database ? $database : $conf['db_database']; + $this->dbUser = $user ? $user : $conf['db_user']; + $this->dbPass = $pass ? $pass : $conf['db_password']; + $this->dbCharset = $conf['db_charset']; + $this->dbNewLink = $conf['db_new_link']; + $this->dbClientFlags = $flags ? $flags : $conf['db_client_flags']; $this->_iConnId = mysqli_init(); mysqli_real_connect($this->_iConnId, $this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort, NULL, $this->dbClientFlags); @@ -279,7 +276,7 @@ class db } if($try > 9) { - $this->_sqlerror('DB::_query -> reconnect', '', true); + $this->_sqlerror('db::_query -> reconnect', '', true); return false; } else { sleep(($try > 7 ? 5 : 1)); @@ -547,7 +544,7 @@ class db //$sAddMsg .= getDebugBacktrace(); - if($this->show_error_messages && $conf[$this->_Prefix.'demo_mode'] === false) { + if($this->show_error_messages && $conf['demo_mode'] === false) { echo $sErrormsg . $sAddMsg; } elseif(is_object($app) && method_exists($app, 'log') && $bNoLog == false) { $app->log($sErrormsg . $sAddMsg . ' -> ' . $mysql_errno . ' (' . $mysql_error . ')', LOGLEVEL_WARN, false); diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index 9e8169fbf58b19a72efbe44628da6bb5da3d9c9f..283695d7bef6deb6bf2b78dd2b85f3534d592c78 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -43,8 +43,6 @@ class db private $_iQueryId; private $_iConnId; - private $_Prefix = ''; // config variable name prefix - private $dbHost = ''; // hostname of the MySQL server private $dbPort = ''; // port of the MySQL server private $dbName = ''; // logical database name on that server @@ -74,18 +72,17 @@ class db */ // constructor - public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL, $port = NULL, $flags = NULL, $confPrefix = '') { + public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL, $port = NULL, $flags = NULL) { global $app, $conf; - if($confPrefix != '') $this->_Prefix = $confPrefix . '_'; - $this->dbHost = $host ? $host : $conf[$this->_Prefix.'db_host']; - $this->dbPort = $port ? $port : $conf[$this->_Prefix.'db_port']; - $this->dbName = $database ? $database : $conf[$this->_Prefix.'db_database']; - $this->dbUser = $user ? $user : $conf[$this->_Prefix.'db_user']; - $this->dbPass = $pass ? $pass : $conf[$this->_Prefix.'db_password']; - $this->dbCharset = $conf[$this->_Prefix.'db_charset']; - $this->dbNewLink = $conf[$this->_Prefix.'db_new_link']; - $this->dbClientFlags = $flags ? $flags : $conf[$this->_Prefix.'db_client_flags']; + $this->dbHost = $host ? $host : $conf['db_host']; + $this->dbPort = $port ? $port : $conf['db_port']; + $this->dbName = $database ? $database : $conf['db_database']; + $this->dbUser = $user ? $user : $conf['db_user']; + $this->dbPass = $pass ? $pass : $conf['db_password']; + $this->dbCharset = $conf['db_charset']; + $this->dbNewLink = $conf['db_new_link']; + $this->dbClientFlags = $flags ? $flags : $conf['db_client_flags']; $this->_iConnId = mysqli_init(); mysqli_real_connect($this->_iConnId, $this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort, NULL, $this->dbClientFlags); @@ -279,7 +276,7 @@ class db } if($try > 9) { - $this->_sqlerror('DB::_query -> reconnect', '', true); + $this->_sqlerror('db::_query -> reconnect', '', true); return false; } else { sleep(($try > 7 ? 5 : 1)); @@ -547,7 +544,7 @@ class db //$sAddMsg .= getDebugBacktrace(); - if($this->show_error_messages && $conf[$this->_Prefix.'demo_mode'] === false) { + if($this->show_error_messages && $conf['demo_mode'] === false) { echo $sErrormsg . $sAddMsg; } elseif(is_object($app) && method_exists($app, 'log') && $bNoLog == false) { $app->log($sErrormsg . $sAddMsg . ' -> ' . $mysql_errno . ' (' . $mysql_error . ')', LOGLEVEL_WARN, false);