We need that extensions for almost everything
This function will return a hard coded
XML string (with headers) if the SimpleXML extension isn't loaded.
Then it will terminate the script.
See bug #1787137
public static checkForExtensions ( array $arrExt = [] ) : void | ||
$arrExt | array | additional extensions for which a check should run |
return | void |
/** * call the parent constructor and check for needed extensions */ public function __construct() { CommonFunctions::checkForSVN(); CommonFunctions::checkForExtensions(); $this->error = Error::singleton(); $this->_checkConfig(); }
/** * generate the static page * * @return void */ public function run() { CommonFunctions::checkForExtensions(array('xsl')); $xmlfile = $this->getXMLString(); $xslfile = "phpsysinfo.xslt"; $domxml = new DOMDocument(); $domxml->loadXML($xmlfile); $domxsl = new DOMDocument(); $domxsl->load($xslfile); $xsltproc = new XSLTProcessor(); $xsltproc->importStyleSheet($domxsl); echo $xsltproc->transformToXML($domxml); }