Skip to content

Commit 5eafbcd

Browse files
author
Marius Cramer
committed
- don't set connect params in constructor (too early)
1 parent d7ad8f3 commit 5eafbcd

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

install/lib/mysql.lib.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,21 @@ class db extends mysqli
6060
////
6161
*/
6262

63-
// constructor
64-
public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL) {
63+
public function __destruct() {
64+
if($this->_iConnId) mysqli_close($this->_iConnId);
65+
}
66+
67+
private function do_connect() {
6568
global $conf;
66-
69+
70+
if($this->_iConnId) return true;
6771
$this->dbHost = $conf["mysql"]["host"];
6872
$this->dbName = '';
6973
$this->dbUser = $conf["mysql"]["admin_user"];
7074
$this->dbPass = $conf["mysql"]["admin_password"];
7175
$this->dbCharset = $conf["mysql"]["charset"];
7276
$this->dbNewLink = false;
7377
$this->dbClientFlags = null;
74-
}
75-
76-
public function __destruct() {
77-
if($this->_iConnId) mysqli_close($this->_iConnId);
78-
}
79-
80-
private function do_connect() {
81-
if($this->_iConnId) return true;
8278

8379
$this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass);
8480
$try = 0;

0 commit comments

Comments
 (0)