Skip to content
Snippets Groups Projects
Commit 40c6e8fd authored by Marius Cramer's avatar Marius Cramer
Browse files

- fix for installer mysql lib

parent ca2165e4
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,15 @@ class db extends mysqli ...@@ -71,7 +71,15 @@ class db extends mysqli
$this->dbCharset = $conf["mysql"]["charset"]; $this->dbCharset = $conf["mysql"]["charset"];
$this->dbNewLink = false; $this->dbNewLink = false;
$this->dbClientFlags = null; $this->dbClientFlags = null;
}
public function __destruct() {
if($this->_iConnId) mysqli_close($this->_iConnId);
}
private function connect() {
if($this->_iConnId) return true;
$this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass);
$try = 0; $try = 0;
while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) { while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) {
...@@ -94,11 +102,7 @@ class db extends mysqli ...@@ -94,11 +102,7 @@ class db extends mysqli
$this->_setCharset(); $this->_setCharset();
} }
public function __destruct() {
if($this->_iConnId) mysqli_close($this->_iConnId);
}
public function close() { public function close() {
if($this->_iConnId) mysqli_close($this->_iConnId); if($this->_iConnId) mysqli_close($this->_iConnId);
$this->_iConnId = null; $this->_iConnId = null;
...@@ -176,6 +180,8 @@ class db extends mysqli ...@@ -176,6 +180,8 @@ class db extends mysqli
private function _query($sQuery = '') { private function _query($sQuery = '') {
global $app; global $app;
$this->connect();
//if($this->isConnected == false) return false; //if($this->isConnected == false) return false;
if ($sQuery == '') { if ($sQuery == '') {
$this->_sqlerror('Keine Anfrage angegeben / No query given'); $this->_sqlerror('Keine Anfrage angegeben / No query given');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment