Ejemplo n.º 1
0
 private function getXMLReport()
 {
     $fileScanner = new FileList();
     $dom = new DOMDocument('1.0', 'utf-8');
     // create report container
     $websiteInfoNode = $dom->createElement('website_info');
     $dom->appendChild($websiteInfoNode);
     // gather server info and append it to the report
     $wsEnv = new WebServerEnvInfo();
     $wsEnvNode = $wsEnv->getXMLNode();
     $dom->documentElement->appendChild($dom->importNode($wsEnvNode, true));
     // gather cms list and append it to the report
     $cmsDetector = new CmsVersionDetector($_SERVER['DOCUMENT_ROOT']);
     $cmsListNode = $cmsDetector->getXMLNode();
     $dom->documentElement->appendChild($dom->importNode($cmsListNode, true));
     // retrieve list of files and append it to the report
     $tmpXmlDoc = new DOMDocument();
     $tmpXmlDoc->loadXML('<files>' . $fileScanner->getXMLFilelist() . '</files>');
     $dom->documentElement->appendChild($dom->importNode($tmpXmlDoc->documentElement, true));
     return $dom->saveXML();
 }