X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FPackager.php;h=f27c38a0a8b0f7e623b71cf514dc1f9b0b6850e5;hb=eb2c17b22d341aab784dadbb4f80fc9e992eff3a;hp=0b133e357909f937b75d8244f8d3899ac4df7d45;hpb=35f1191ab8ca06052eb08e05322c5d7ff87187dd;p=pharext%2Fpharext diff --git a/src/pharext/Packager.php b/src/pharext/Packager.php index 0b133e3..f27c38a 100644 --- a/src/pharext/Packager.php +++ b/src/pharext/Packager.php @@ -64,17 +64,21 @@ class Packager implements Command $this->help($prog); exit; } - - if ($this->args["source"]) { - if ($this->args["pecl"]) { - $this->source = new PeclSourceDir($this, $this->args["source"]); - } elseif ($this->args["git"]) { - $this->source = new GitSourceDir($this, $this->args["source"]); - } elseif (realpath($this->args["source"]."/pharext_package.php")) { - $this->source = new PharextSourceDir($this, $this->args["source"]); - } else { - $this->source = new FilteredSourceDir($this, $this->args["source"]); + + try { + if ($this->args["source"]) { + if ($this->args["pecl"]) { + $this->source = new PeclSourceDir($this, $this->args["source"]); + } elseif ($this->args["git"]) { + $this->source = new GitSourceDir($this, $this->args["source"]); + } elseif (realpath($this->args["source"]."/pharext_package.php")) { + $this->source = new PharextSourceDir($this, $this->args["source"]); + } else { + $this->source = new FilteredSourceDir($this, $this->args["source"]); + } } + } catch (\Exception $e) { + $errs[] = $e->getMessage(); } foreach ($this->args->validate() as $error) { @@ -88,6 +92,7 @@ class Packager implements Command foreach ($errs as $err) { $this->error("%s\n", $err); } + printf("\n"); if (!$this->args["quiet"]) { $this->help($prog); } @@ -119,7 +124,7 @@ class Packager implements Command $this->info("Creating phar %s ...%s", $pkgtemp, $this->args->verbose ? "\n" : " "); try { - $package = new Phar($pkgtemp, 0, "ext.phar"); + $package = new Phar($pkgtemp); $package->startBuffering(); $package->buildFromIterator($this->source, $this->source->getBaseDir()); $package->buildFromIterator($this->bundle());