From a4a4eaa93959dacf601b940d6988e5e995611777 Mon Sep 17 00:00:00 2001 From: Falko Timme <ft@falkotimme.com> Date: Thu, 27 Nov 2014 11:29:59 -0500 Subject: [PATCH] - Added translations. - Added HHVM to "Default PHP Handler" field (server configuration). - Fixed "Unable to load the server configuration from database." error when running server.sh. - Fixed Javascript (accordions weren't working anymore, directive snippets and other placeholders couldn't be added anymore). --- server/lib/classes/db_mysql.inc.php | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index af846ef..c0eed64 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; @@ -424,7 +436,7 @@ if($this->show_error_messages && $conf['demo_mode'] === false) { echo $sErrormsg . $sAddMsg; } else if(is_object($app) && method_exists($app, 'log')) { - $app->log($sErrormsg . $sAddMsg, LOGLEVEL_WARN); + $app->log($sErrormsg . $sAddMsg . ' -> ' . $mysql_errno . ' (' . $mysql_error . ')', LOGLEVEL_WARN); } } -- Gitblit v1.9.1