fix normal/verbose/quiet output
authorMichael Wallner <mike@php.net>
Tue, 9 Apr 2019 06:41:42 +0000 (08:41 +0200)
committerMichael Wallner <mike@php.net>
Wed, 4 Sep 2019 07:29:47 +0000 (09:29 +0200)
src/pharext/Task/BundleGenerator.php
src/pharext/Task/PharCompress.php
src/pharext/Task/PharSign.php
src/pharext/Task/StreamFetch.php

index 28af6271eaf209b19ded2c1d70c35c703afec6ad..5b36fa99e8304570fa626e424b96cb04c1d71797 100644 (file)
@@ -17,7 +17,7 @@ class BundleGenerator implements Task
         * @return Generator
         */
        public function run($verbose = false) {
-               if ($verbose) {
+               if ($verbose !== false) {
                        printf("Packaging pharext ... \n");
                }
                $rdi = new RecursiveDirectoryIterator(dirname(dirname(__DIR__)));
index 78a93493018dd3eded7797c670bf87483567219b..1b6571fe835c57d08d4e9280ee6fad696e4dccf9 100644 (file)
@@ -55,7 +55,7 @@ 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 */
index 8fa1e466f11c4d76c2ddabf91f8021bc42ad3950..62ec9253a2a92af57ed8e8f476f3b6658a69390c 100644 (file)
@@ -42,7 +42,7 @@ class PharSign implements Task
         * @return \pharext\Openssl\PrivateKey
         */
        public function run($verbose = false) {
-               if ($verbose) {
+               if ($verbose !== false) {
                        printf("Signing %s ...\n", basename($this->phar->getPath()));
                }
                $this->pkey->sign($this->phar);
index 029754ef773e906b7d9e57df012f511afc3d5ace..d2a9e821d9856a80012f985f3e4d29f6af69f4a8 100644 (file)
@@ -65,7 +65,7 @@ class StreamFetch implements Task
                }
                $context = $this->createStreamContext();
 
-               if (!$remote = fopen($this->source, "r", false, $context)) {
+               if (!$remote = @fopen($this->source, "r", false, $context)) {
                        throw new Exception;
                }