X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FTask%2FPharCompress.php;h=1b6571fe835c57d08d4e9280ee6fad696e4dccf9;hb=2419fff2970ab8262ad08ec0fac1867d119fd768;hp=ea0607f39a6e9291a91204b9cdcfa7a97d0a2e20;hpb=337e76964be2ed6724633ac477affc3a28426c97;p=pharext%2Fpharext diff --git a/src/pharext/Task/PharCompress.php b/src/pharext/Task/PharCompress.php index ea0607f..1b6571f 100644 --- a/src/pharext/Task/PharCompress.php +++ b/src/pharext/Task/PharCompress.php @@ -55,15 +55,13 @@ class PharCompress implements Task * @return string */ public function run($verbose = false) { - if ($verbose) { + if ($verbose !== false) { printf("Compressing %s ...\n", basename($this->package->getPath())); } + /* stop shebang */ + $stub = $this->package->getStub(); $phar = $this->package->compress($this->encoding); - $meta = $phar->getMetadata(); - if (isset($meta["stub"])) { - /* drop shebang */ - $phar->setDefaultStub($meta["stub"]); - } + $phar->setStub(substr($stub, strpos($stub, "\n")+1)); return $this->file . $this->extension; } }