X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FTask%2FPharBuild.php;h=03ac42c1019b5d6505eebd0f80b7ef07f9d92206;hb=ac44bc42a000ebb261f71de7ae271b23bd6f3a3d;hp=d6f27881823ffdbce6e0d99036b71be50039c3f3;hpb=861260c111bff72f60665393660b6f5375559510;p=pharext%2Fpharext diff --git a/src/pharext/Task/PharBuild.php b/src/pharext/Task/PharBuild.php index d6f2788..03ac42c 100644 --- a/src/pharext/Task/PharBuild.php +++ b/src/pharext/Task/PharBuild.php @@ -68,11 +68,25 @@ 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); + $phar[$index] = $file; + } else { + printf("Packaging %s ...\n", $index = trim(substr($file, $blen), "/")); + $phar->addFile($file, $index); + } + } + } else { + $phar->buildFromIterator($this->source, $this->source->getBaseDir()); + } } $phar->stopBuffering(); - + if (!chmod($temp, fileperms($temp) | 0111)) { throw new Exception; }