From: Michael Wallner Date: Sat, 28 Mar 2015 10:58:36 +0000 (+0100) Subject: verbose packaging X-Git-Tag: v3.0.0~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=23b4f263e68ae8d0a34292ed6215350483fe8451;p=pharext%2Fpharext verbose packaging --- diff --git a/src/pharext/Task/PharBuild.php b/src/pharext/Task/PharBuild.php index d6f2788..5468755 100644 --- a/src/pharext/Task/PharBuild.php +++ b/src/pharext/Task/PharBuild.php @@ -68,10 +68,27 @@ class PharBuild implements Task $phar->buildFromIterator((new Task\BundleGenerator)->run()); if ($this->source) { - $phar->buildFromIterator($this->source, $this->source->getBaseDir()); + if ($verbose) { + $bdir = $this->source->getBaseDir(); + $blen = strlen($bdir); + foreach ($this->source as $index => $file) { + if (is_resource($file)) { + printf("Packaging %s ...\n", $index); + } else { + printf("Packaging %s ...\n", $index = trim(substr($file, $blen), "/")); + } + $phar[$index] = $file; + } + } else { + $phar->buildFromIterator($this->source, $this->source->getBaseDir()); + } } $phar->stopBuffering(); + + foreach (new \RecursiveIteratorIterator($phar) as $file) { + printf("Packaged %s ...\n", $file); + } if (!chmod($temp, fileperms($temp) | 0111)) { throw new Exception;