diff --git a/lib/Doctrine/deploy/AddServiceGroups.php b/lib/Doctrine/deploy/AddServiceGroups.php index c4e7ba75a..3427093f6 100644 --- a/lib/Doctrine/deploy/AddServiceGroups.php +++ b/lib/Doctrine/deploy/AddServiceGroups.php @@ -10,6 +10,16 @@ $stFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/ServiceGroups.xml"; $sts = simplexml_load_file($stFileName); +// Checking the XML file has parsed correctly +if ($sts === false) { + echo "There were errors parsing the XML file.\n"; + // $error will be an object of the libXMLError class + foreach (libxml_get_errors() as $error) { + echo $error->message; + } + exit; +} + foreach($sts as $st) { $instance = new ServiceGroup(); $name = ""; @@ -36,9 +46,10 @@ $scope = (string) $value; break; default: - throw new LogicException("Unknown ServiceGroup key in input XML: ". $key); + break; } } + $instance->setName($name); $instance->setDescription($desc); $instance->setMonitored($monitored);