From 8a0039422a296021e3e29704ba45bbd10c02bb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Fri, 9 May 2014 18:42:45 +0200 Subject: [PATCH] improved config parsing --- application/core/Database/Database.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/core/Database/Database.php b/application/core/Database/Database.php index 96aa49f8..39c8ce64 100644 --- a/application/core/Database/Database.php +++ b/application/core/Database/Database.php @@ -33,22 +33,23 @@ class Database implements TimerListener { $this->maniaControl = $maniaControl; // Get mysql server information - $host = $this->maniaControl->config->database->xpath('host'); + $databaseXmlTag = $this->maniaControl->config->database; + $host = $databaseXmlTag->xpath('host'); if (!$host) { $message = "Invalid database configuration (host)."; $this->maniaControl->quit($message, true); } - $port = $this->maniaControl->config->database->xpath('port'); + $port = $databaseXmlTag->xpath('port'); if (!$port) { $message = "Invalid database configuration (port)."; $this->maniaControl->quit($message, true); } - $user = $this->maniaControl->config->database->xpath('user'); + $user = $databaseXmlTag->xpath('user'); if (!$user) { $message = "Invalid database configuration (user)."; $this->maniaControl->quit($message, true); } - $pass = $this->maniaControl->config->database->xpath('pass'); + $pass = $databaseXmlTag->xpath('pass'); if (!$pass) { $message = "Invalid database configuration (pass)."; $this->maniaControl->quit($message, true);