@@ -43,8 +43,6 @@ class db
4343 private $ _iQueryId ;
4444 private $ _iConnId ;
4545
46- private $ _Prefix = '' ; // config variable name prefix
47-
4846 private $ dbHost = '' ; // hostname of the MySQL server
4947 private $ dbPort = '' ; // port of the MySQL server
5048 private $ dbName = '' ; // logical database name on that server
@@ -74,18 +72,17 @@ class db
7472 */
7573
7674 // constructor
77- public function __construct ($ host = NULL , $ user = NULL , $ pass = NULL , $ database = NULL , $ port = NULL , $ flags = NULL , $ confPrefix = '' ) {
75+ public function __construct ($ host = NULL , $ user = NULL , $ pass = NULL , $ database = NULL , $ port = NULL , $ flags = NULL ) {
7876 global $ app , $ conf ;
7977
80- if ($ confPrefix != '' ) $ this ->_Prefix = $ confPrefix . '_ ' ;
81- $ this ->dbHost = $ host ? $ host : $ conf [$ this ->_Prefix .'db_host ' ];
82- $ this ->dbPort = $ port ? $ port : $ conf [$ this ->_Prefix .'db_port ' ];
83- $ this ->dbName = $ database ? $ database : $ conf [$ this ->_Prefix .'db_database ' ];
84- $ this ->dbUser = $ user ? $ user : $ conf [$ this ->_Prefix .'db_user ' ];
85- $ this ->dbPass = $ pass ? $ pass : $ conf [$ this ->_Prefix .'db_password ' ];
86- $ this ->dbCharset = $ conf [$ this ->_Prefix .'db_charset ' ];
87- $ this ->dbNewLink = $ conf [$ this ->_Prefix .'db_new_link ' ];
88- $ this ->dbClientFlags = $ flags ? $ flags : $ conf [$ this ->_Prefix .'db_client_flags ' ];
78+ $ this ->dbHost = $ host ? $ host : $ conf ['db_host ' ];
79+ $ this ->dbPort = $ port ? $ port : $ conf ['db_port ' ];
80+ $ this ->dbName = $ database ? $ database : $ conf ['db_database ' ];
81+ $ this ->dbUser = $ user ? $ user : $ conf ['db_user ' ];
82+ $ this ->dbPass = $ pass ? $ pass : $ conf ['db_password ' ];
83+ $ this ->dbCharset = $ conf ['db_charset ' ];
84+ $ this ->dbNewLink = $ conf ['db_new_link ' ];
85+ $ this ->dbClientFlags = $ flags ? $ flags : $ conf ['db_client_flags ' ];
8986 $ this ->_iConnId = mysqli_init ();
9087
9188 mysqli_real_connect ($ this ->_iConnId , $ this ->dbHost , $ this ->dbUser , $ this ->dbPass , '' , (int )$ this ->dbPort , NULL , $ this ->dbClientFlags );
@@ -279,7 +276,7 @@ private function _query($sQuery = '') {
279276 }
280277
281278 if ($ try > 9 ) {
282- $ this ->_sqlerror ('DB ::_query -> reconnect ' , '' , true );
279+ $ this ->_sqlerror ('db ::_query -> reconnect ' , '' , true );
283280 return false ;
284281 } else {
285282 sleep (($ try > 7 ? 5 : 1 ));
@@ -547,7 +544,7 @@ private function _sqlerror($sErrormsg = 'Unbekannter Fehler', $sAddMsg = '', $bN
547544
548545 //$sAddMsg .= getDebugBacktrace();
549546
550- if ($ this ->show_error_messages && $ conf [$ this -> _Prefix . 'demo_mode ' ] === false ) {
547+ if ($ this ->show_error_messages && $ conf ['demo_mode ' ] === false ) {
551548 echo $ sErrormsg . $ sAddMsg ;
552549 } elseif (is_object ($ app ) && method_exists ($ app , 'log ' ) && $ bNoLog == false ) {
553550 $ app ->log ($ sErrormsg . $ sAddMsg . ' -> ' . $ mysql_errno . ' ( ' . $ mysql_error . ') ' , LOGLEVEL_WARN , false );
0 commit comments