From f1faa5d5581fe240060f7bdf3cf4d82808471b65 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 28 May 2007 15:52:36 +0000 Subject: [PATCH] - It is more unlikely to be looking for files named '0' or '1' and those are also quite intuitive if seeing them as return value of the search. --- ext/phar/Makefile.frag | 2 +- ext/phar/phar.php | 6 +++--- ext/phar/phar/pharcommand.inc | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index 734f0e6d58..c6017a73c2 100755 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -5,6 +5,6 @@ $(srcdir)/phar_path_check.c: $(srcdir)/phar_path_check.re pharcmd: $(builddir)/phar.phar $(builddir)/phar.phar: $(srcdir)/phar/*.inc $(srcdir)/phar/*.php - php -d phar.readonly=0 $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x CVS -p optional -s $(srcdir)/phar/phar.php -h sha1 $(srcdir)/phar/ + php -d phar.readonly=0 $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x CVS -p 0 -s $(srcdir)/phar/phar.php -h sha1 $(srcdir)/phar/ @chmod +x $(builddir)/phar.phar diff --git a/ext/phar/phar.php b/ext/phar/phar.php index c2dbd43099..62db215a39 100644 --- a/ext/phar/phar.php +++ b/ext/phar/phar.php @@ -371,7 +371,7 @@ class PharCommand extends CLICommand static function cli_arg_typ_loader($arg) { - if ($arg == 'auto' || $arg == 'optional') + if (($arg == '0' || $arg == '1') && !file_exists($arg)) { $found = NULL; foreach(split("\n", `pear list-files PHP_Archive`) as $ent) @@ -385,7 +385,7 @@ class PharCommand extends CLICommand } if (!isset($found)) { echo "Pear package PHP_Archive or Archive.php class file not found.\n"; - if ($arg != 'optional') + if ($arg != '0') { exit(1); } @@ -485,7 +485,7 @@ class PharCommand extends CLICommand 'f' => array('typ'=>'pharnew', 'val'=>NULL, 'required'=>1, 'inf'=>' Specifies the phar file to work on.'), 'h' => array('typ'=>'select', 'val'=>NULL, 'inf'=>' Selects the hash algorithmn.', 'select'=>array('md5'=>'MD5','sha1'=>'SHA1','sha256'=>'SHA256','sha512'=>'SHA512')), 'i' => array('typ'=>'regex', 'val'=>NULL, 'inf'=>' Specifies a regular expression for input files.'), - 'p' => array('typ'=>'loader', 'val'=>NULL, 'inf'=>' Location of PHP_Archive class file (pear list-files PHP_Archive). You can use \'auto\' or \'optional\' to locate it automatically using the mentioned pear command. When using \'optional\' the command does not error out when the class file cannot be located.'), + 'p' => array('typ'=>'loader', 'val'=>NULL, 'inf'=>' Location of PHP_Archive class file (pear list-files PHP_Archive). You can use \'0\' or \'1\' to locate it automatically using the mentioned pear command. When using \'0\' the command does not error out when the class file cannot be located.'), 's' => array('typ'=>'file', 'val'=>NULL, 'inf'=>' Select the stub file (excluded from list of input files/dirs).'), 'x' => array('typ'=>'regex', 'val'=>NULL, 'inf'=>' Regular expression for input files to exclude.'), '' => array('typ'=>'any', 'val'=>NULL, 'required'=>1, 'inf'=>' Any number of input files and directories.'), diff --git a/ext/phar/phar/pharcommand.inc b/ext/phar/phar/pharcommand.inc index 35dae64622..e8768c9ed6 100755 --- a/ext/phar/phar/pharcommand.inc +++ b/ext/phar/phar/pharcommand.inc @@ -111,7 +111,7 @@ class PharCommand extends CLICommand 'p' => array( 'typ' => 'loader', 'val' => NULL, - 'inf' => ' Location of PHP_Archive class file (pear list-files PHP_Archive). You can use \'auto\' or \'optional\' to locate it automatically using the mentioned pear command. When using \'optional\' the command does not error out when the class file cannot be located.', + 'inf' => ' Location of PHP_Archive class file (pear list-files PHP_Archive). You can use \'0\' or \'1\' to locate it automatically using the mentioned pear command. When using \'0\' the command does not error out when the class file cannot be located.', ), 's' => array( 'typ' => 'file', @@ -188,7 +188,7 @@ class PharCommand extends CLICommand */ static function cli_arg_typ_loader($arg, $cfg, $key) { - if ($arg == 'auto' || $arg == 'optional') { + if (($arg == '0' || $arg == '1') && !file_exists($arg)) { $found = NULL; foreach(split("\n", `pear list-files PHP_Archive`) as $ent) { $matches = NULL; @@ -199,7 +199,7 @@ class PharCommand extends CLICommand } if (!isset($found)) { $msg = "Pear package PHP_Archive or Archive.php class file not found.\n"; - if ($arg == 'optional') { + if ($arg == '0') { self::notice($msg); } else { self::error($msg); -- 2.50.1