From 23b4f263e68ae8d0a34292ed6215350483fe8451 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Sat, 28 Mar 2015 11:58:36 +0100 Subject: [PATCH] verbose packaging --- src/pharext/Task/PharBuild.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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; -- 2.30.2