/** * Class constructor * * @param string $xsdFile path to the xsd * @param array $options an array of parameters overload the default configuration */ public function __construct($xsdFile, $options = array()) { //@todo gerer le cas ou le xsd est distant - pas besoin pour le moment //@todo permettre de trouver dans le xml à tester le path vers le xsd if (!XmlCrawlerHelper::pathIsLocal($xsdFile)) { throw new XmlCrawlerException('The remote xsd are not yet manage in this version of XmlCrawlerValidator'); } if (!file_exists($xsdFile)) { throw new XmlCrawlerException('Can not find ' . $xsdFile); } $this->localXsd = $xsdFile; $this->setDefaultConfiguration(); $this->overideConfiguration($options); }
/** * Class constructor * * @param string $xmlFile path to the xml * @param array $options an array of parameters overload the default configuration */ public function __construct($xmlFile, $options = array()) { $this->setDefaultConfiguration(); $this->overideConfiguration($options); if (!XmlCrawlerHelper::pathIsLocal($xmlFile)) { $this->validWorkingFolder(); $this->validCurl(); $this->distantXml = $xmlFile; } elseif (!file_exists($xmlFile)) { throw new XmlCrawlerException('Can not find ' . $xmlFile); } else { $this->localXml = $xmlFile; } $this->setDefaultConfiguration(); $this->overideConfiguration($options); }