public function __construct($path)
{
if (is_file("{$path}/package2.xml")) {
$sxe = simplexml_load_file($this->file = "{$path}/package2.xml");
} elseif (is_file("{$path}/package.xml")) {
$sxe = simplexml_load_file($this->file = "{$path}/package.xml");
} else {
throw new Exception("Missing package.xml in {$path}");
}
$sxe->registerXPathNamespace("pecl", $sxe->getDocNamespaces()[""]);
$this->sxe = $sxe;
$this->path = realpath($path);
}