pharext\SourceDir\Pecl::__construct PHP Method

__construct() public method

See also: pharext\SourceDir::__construct()
public __construct ( $path )
    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);
    }