- 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);
- }
+ $bdir = $this->source->getBaseDir();
+ $blen = strlen($bdir);
+ foreach ($this->source as $index => $file) {
+ if (is_resource($file)) {
+ $mode = fstat($file)["mode"] & 07777;
+ $phar[$index] = $file;
+ } else {
+ $mode = stat($file)["mode"] & 07777;
+ $index = trim(substr($file, $blen), "/");
+ $phar->addFile($file, $index);