From: Greg Beaver Date: Fri, 23 Nov 2007 05:51:59 +0000 (+0000) Subject: MFB fixes to phar.phar X-Git-Tag: RELEASE_2_0_0a1~1302 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d13f86703d50fa461da181dc626e72305a17a90;p=php MFB fixes to phar.phar --- diff --git a/ext/phar/package.php b/ext/phar/package.php index 9701c4358e..25bf354a16 100644 --- a/ext/phar/package.php +++ b/ext/phar/package.php @@ -34,6 +34,7 @@ $options = array( 'Makefile.frag' => 'src', 'phar_path_check.re' => 'src', 'TODO' => 'doc', + 'phar.phar' => 'script', ), ); diff --git a/ext/phar/phar.phar b/ext/phar/phar.phar index 793e7189e8..9686edc739 100755 Binary files a/ext/phar/phar.phar and b/ext/phar/phar.phar differ diff --git a/ext/phar/phar/clicommand.inc b/ext/phar/phar/clicommand.inc index 455dfa4446..067456d691 100755 --- a/ext/phar/phar/clicommand.inc +++ b/ext/phar/phar/clicommand.inc @@ -219,7 +219,7 @@ abstract class CLICommand if ($f === false) { self::error("Path for file '$arg' does not exist.\n"); } - return $f . substr($arg, strlen($d));; + return $f . '/' . basename($arg); } static function cli_arg_typ_filecont($arg, $cfg, $key) diff --git a/ext/phar/phar/phar.php b/ext/phar/phar/phar.php index 93a938842c..68a437b206 100755 --- a/ext/phar/phar/phar.php +++ b/ext/phar/phar/phar.php @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/local/bin/php $f) { + $any = true; call_user_func($func, $pn, $f, $args); } + return $any; } // {{{ static function cli_cmd_inf_list /** @@ -687,11 +690,14 @@ class PharCommand extends CLICommand */ public function cli_cmd_run_tree() { - $this->phar_dir_operation( + $a = $this->phar_dir_operation( new DirectoryGraphIterator( $this->args['f']['val']), array($this, 'phar_dir_echo') ); + if (!$a) { + echo "|-\n"; + } } // }}} // {{{ cli_cmd_inf_extract @@ -746,7 +752,7 @@ class PharCommand extends CLICommand } } - $phar = $args['f']['val']; + $phar = $this->args['f']['val']; $base = $phar->getPathname(); $bend = strpos($base, '.phar'); $bend = strpos($base, '/', $bend); @@ -1192,11 +1198,13 @@ class PharCommand extends CLICommand if (isset($entry)) { if (!$phar[$entry]->hasMetadata()) { + echo "No Metadata\n"; exit(1); } echo serialize($phar[$entry]->getMetadata()); } else { if (!$phar->hasMetadata()) { + echo "No Metadata\n"; exit(1); } $meta = $phar->getMetadata(); @@ -1208,6 +1216,7 @@ class PharCommand extends CLICommand echo $meta[$index]; exit(0); } else { + echo "No Metadata\n"; exit(1); } } else {