+ /**
+ * Load the source dir
+ * @throws \pharext\Exception
+ */
+ private function loadSource(){
+ if ($this->args["source"]) {
+ $source = $this->localize($this->args["source"]);
+
+ if ($this->args["pecl"]) {
+ $this->source = new SourceDir\Pecl($source);
+ } elseif ($this->args["git"]) {
+ $this->source = new SourceDir\Git($source);
+ } elseif (is_file("$source/parext_package.php")) {
+ $this->source = include "$source/pharext_package.php";
+ }
+
+ if (!$this->source instanceof SourceDir) {
+ throw new Exception("Unknown source dir $source");
+ }
+
+ foreach ($this->source->getPackageInfo() as $key => $val) {
+ $this->args->$key = $val;
+ }
+ }
+ }
+