/** * Create a new parser instance. * * @throws Exception if there is no basic xml support in your PHP installation. */ public function __construct() { if (self::$libxmlHasFlagSupport === false) { if (!extension_loaded('libxml')) { throw new Exception('The libxml extension is not loaded'); } if (!extension_loaded('SimpleXML')) { throw new Exception('The SimpleXML extension is not loaded'); } self::$libxmlHasFlagSupport = version_compare(phpversion(), '5.1') != -1 && defined('LIBXML_VERSION'); } }