diff options
author | Greg Beaver <cellog@php.net> | 2007-11-23 04:47:38 +0000 |
---|---|---|
committer | Greg Beaver <cellog@php.net> | 2007-11-23 04:47:38 +0000 |
commit | d26e1e4e8aeb4fa52a431257394b522ba2d7ada0 (patch) | |
tree | e8cbd1f8d5c80342d7314dd869a79cee4ff67cfa | |
parent | 8d266745ded058ea16b17166ccdc3e3842ddf5ba (diff) | |
download | php-git-d26e1e4e8aeb4fa52a431257394b522ba2d7ada0.tar.gz |
fully fix phar.phar so that
- 'No Metadata' is displayed on meta-get if there ain't none
- '|-<root directory>' is displayed for tree command if no sub-directories are present
-rw-r--r-- | ext/phar/package.xml | 47 | ||||
-rwxr-xr-x | ext/phar/phar.phar | bin | 14106 -> 14155 bytes | |||
-rwxr-xr-x | ext/phar/phar/pharcommand.inc | 14 |
3 files changed, 44 insertions, 17 deletions
diff --git a/ext/phar/package.xml b/ext/phar/package.xml index c1d2e5a869..6b9f3a9036 100644 --- a/ext/phar/package.xml +++ b/ext/phar/package.xml @@ -29,10 +29,10 @@ avaiable then SHA-256 and SHA-512 signatures are supported as well.</description <email>helly@php.net</email> <active>yes</active> </lead> - <date>2007-10-03</date> - <time>22:48:03</time> + <date>2007-11-22</date> + <time>22:37:06</time> <version> - <release>1.2.2</release> + <release>1.2.3</release> <api>1.1.0</api> </version> <stability> @@ -42,10 +42,12 @@ avaiable then SHA-256 and SHA-512 signatures are supported as well.</description <license uri="http://www.php.net/license">PHP License</license> <notes> - * fix to work with PHP 5.3 - * fix Bug #12124: Phar object cannot be iterated over - * remove unused variables - * fix jit file open sprintf calls + * fix creation of Phar object with relative path: + $a = new Phar('blah.phar'); + * fix creation and read of Phar objects on Windows, manage + windows path separators (on windows only) + * fix Bug #12492: filenew incorrectly creates file path [urkle] + * fix Bug #12493: extract throws an error and won't open the file [urkle] </notes> <contents> @@ -162,6 +164,7 @@ avaiable then SHA-256 and SHA-512 signatures are supported as well.</description <file name="phar_stub_write_file.phpt" role="test" /> <file name="phar_test.inc" role="test" /> <file name="refcount1.phpt" role="test" /> + <file name="refcount1_5_2.phpt" role="test" /> <file name="rename.phpt" role="test" /> </dir> <!-- /tests --> <file name="build_precommand.php" role="php" /> @@ -214,26 +217,44 @@ avaiable then SHA-256 and SHA-512 signatures are supported as well.</description <changelog> <release> <version> - <release>1.2.2</release> + <release>1.2.3</release> <api>1.1.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> - <date>2007-10-03</date> + <date>2007-11-22</date> <license uri="http://www.php.net/license">PHP License</license> <notes> - * fix to work with PHP 5.3 - * fix Bug #12124: Phar object cannot be iterated over - * remove unused variables - * fix jit file open sprintf calls + * fix creation of Phar object with relative path: + $a = new Phar('blah.phar'); + * fix creation and read of Phar objects on Windows, manage + windows path separators (on windows only) + * fix Bug #12492: filenew incorrectly creates file path [urkle] + * fix Bug #12493: extract throws an error and won't open the file [urkle] </notes> </release> <release> <version> + <release>1.2.2</release> + <api>1.1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <date>2007-10-03</date> + <license uri="http://www.php.net/license">PHP License</license> + <notes>* fix to work with PHP 5.3 +* fix Bug #12124: Phar object cannot be iterated over +* remove unused variables +* fix jit file open sprintf calls</notes> + </release> + <release> + <version> <release>1.2.1</release> <api>1.1.0</api> </version> diff --git a/ext/phar/phar.phar b/ext/phar/phar.phar Binary files differindex c47709eb18..6a60d65d86 100755 --- a/ext/phar/phar.phar +++ b/ext/phar/phar.phar diff --git a/ext/phar/phar/pharcommand.inc b/ext/phar/phar/pharcommand.inc index 26dbc33853..7c9bcf5e17 100755 --- a/ext/phar/phar/pharcommand.inc +++ b/ext/phar/phar/pharcommand.inc @@ -612,9 +612,12 @@ class PharCommand extends CLICommand $dir = new InvertedRegexIterator($dir, $invregex); } + $any = false; foreach($dir as $pn => $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 "|-<root directory>\n"; + } } // }}} // {{{ cli_cmd_inf_extract @@ -1192,13 +1198,13 @@ class PharCommand extends CLICommand if (isset($entry)) { if (!$phar[$entry]->hasMetadata()) { - echo 'No Metadata'; + echo "No Metadata\n"; exit(1); } echo serialize($phar[$entry]->getMetadata()); } else { if (!$phar->hasMetadata()) { - echo 'No Metadata'; + echo "No Metadata\n"; exit(1); } $meta = $phar->getMetadata(); @@ -1210,7 +1216,7 @@ class PharCommand extends CLICommand echo $meta[$index]; exit(0); } else { - echo 'No Metadata'; + echo "No Metadata\n"; exit(1); } } else { |