From 68c9c4e5555954fc470e359a149fa5b0a2e459a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Tue, 5 Aug 2014 02:08:11 +0200 Subject: [PATCH] fixed shutdowns on errors --- application/core/Database/Database.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/core/Database/Database.php b/application/core/Database/Database.php index bb461d75..9c7a08ce 100644 --- a/application/core/Database/Database.php +++ b/application/core/Database/Database.php @@ -67,35 +67,35 @@ class Database implements TimerListener { private function loadConfig() { $databaseElements = $this->maniaControl->getConfig()->xpath('database'); if (!$databaseElements) { - Logger::logError('No Database configured!', E_USER_ERROR); + $this->maniaControl->quit('No Database configured!', true); } $databaseElement = $databaseElements[0]; // Host $hostElements = $databaseElement->xpath('host'); if (!$hostElements) { - Logger::logError("Invalid database configuration (Host).", E_USER_ERROR); + $this->maniaControl->quit("Invalid database configuration (Host).", true); } $host = (string)$hostElements[0]; // Port $portElements = $databaseElement->xpath('port'); if (!$portElements) { - Logger::logError("Invalid database configuration (Port).", E_USER_ERROR); + $this->maniaControl->quit("Invalid database configuration (Port).", true); } $port = (string)$portElements[0]; // User $userElements = $databaseElement->xpath('user'); if (!$userElements) { - Logger::logError("Invalid database configuration (User).", E_USER_ERROR); + $this->maniaControl->quit("Invalid database configuration (User).", true); } $user = (string)$userElements[0]; // Pass $passElements = $databaseElement->xpath('pass'); if (!$passElements) { - Logger::logError("Invalid database configuration (Pass).", E_USER_ERROR); + $this->maniaControl->quit("Invalid database configuration (Pass).", true); } $pass = (string)$passElements[0]; @@ -105,7 +105,7 @@ class Database implements TimerListener { $nameElements = $databaseElement->xpath('db_name'); } if (!$nameElements) { - Logger::logError("Invalid database configuration (Name).", E_USER_ERROR); + $this->maniaControl->quit("Invalid database configuration (Name).", true); } $name = (string)$nameElements[0];