FileUtil::loadConfig now returns a DOMDocument

improved config loading & error output
This commit is contained in:
Steffen Schröder
2014-06-13 17:54:38 +02:00
parent 0ecd68a6fd
commit 58b07f266c
2 changed files with 22 additions and 7 deletions

View File

@ -65,7 +65,7 @@ class ManiaControl implements CommandListener, TimerListener {
public $authenticationManager = null;
public $callbackManager = null;
public $chat = null;
/** @var \SimpleXMLElement $config */
/** @var \DOMElement $config */
public $config = null;
public $configurator = null;
/** @var Connection $client */
@ -160,7 +160,7 @@ class ManiaControl implements CommandListener, TimerListener {
if (!$this->config) {
$this->quit("Error loading Configuration XML-File! ('{$configFileName}')", true);
}
if ($this->config->count() < 3) {
if ($this->config->childNodes->length < 3) {
$this->quit("Your Configuration File ('{$configFileName}') doesn't seem to be maintained properly. Please check it again!", true);
}
}