From 77cc4a99b15f4639b56c29a1207dc04b459c5d54 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Fri, 19 Dec 2014 12:18:11 -0500
Subject: [PATCH] - re-added jquery ui

---
 server/lib/classes/db_mysql.inc.php |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php
index e6600e9..51cad86 100644
--- a/server/lib/classes/db_mysql.inc.php
+++ b/server/lib/classes/db_mysql.inc.php
@@ -176,6 +176,7 @@
 	private function _query($sQuery = '') {
 		global $app;
 
+		if($this->isConnected == false) return false;
 		if ($sQuery == '') {
 			$this->_sqlerror('Keine Anfrage angegeben / No query given');
 			return false;
@@ -187,6 +188,17 @@
 			$ok = mysqli_ping($this->_iConnId);
 			if(!$ok) {
 				if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName)) {
+					if($this->errorNumber == '111') {
+						// server is not available
+						if($try > 9) {
+							if(isset($app) && isset($app->forceErrorExit)) {
+								$app->forceErrorExit('Database connection failure!');
+							}
+							// if we reach this, the app object is missing or has no exit method, so we continue as normal
+						}
+						sleep(30); // additional seconds, please!
+					}
+
 					if($try > 9) {
 						$this->_sqlerror('DB::query -> reconnect');
 						return false;

--
Gitblit v1.9.1