fix normal/verbose/quiet output
[pharext/pharext] / src / pharext / Task / PharCompress.php
index ea0607f39a6e9291a91204b9cdcfa7a97d0a2e20..1b6571fe835c57d08d4e9280ee6fad696e4dccf9 100644 (file)
@@ -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;
        }
 }