cvs: php-src(PHP_4_3) /pear/scripts pear.bat pearcmd.php
| From: | Greg Beaver | Date: | Tue, 08 Jun 2004 17:56:45 +0000 |
| Subject: | cvs: php-src(PHP_4_3) /pear/scripts pear.bat pearcmd.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-377@lists.php.net to get a copy of this message | ||
cellog Tue Jun 8 13:56:45 2004 EDT
Modified files: (Branch: PHP_4_3)
/php-src/pear/scripts pear.bat pearcmd.php
Log:
MFH
fix bug #1158
fix bug #1153
http://cvs.php.net/diff.php/php-src/pear/scripts/pear.bat?r1=1.10.4.15&r2=1.10.4.16&ty=u
Index: php-src/pear/scripts/pear.bat
diff -u php-src/pear/scripts/pear.bat:1.10.4.15 php-src/pear/scripts/pear.bat:1.10.4.16
--- php-src/pear/scripts/pear.bat:1.10.4.15 Sat Mar 13 13:29:29 2004
+++ php-src/pear/scripts/pear.bat Tue Jun 8 13:56:45 2004
@@ -64,6 +64,6 @@
ECHO %PHP_PEAR_PHP_BIN%
GOTO END
:RUN
-"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d register_argc_argv=On -d
include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" --
%1 %2 %3 %4 %5 %6 %7 %8 %9
+"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d
include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" --
%1 %2 %3 %4 %5 %6 %7 %8 %9
:END
@ECHO ON
http://cvs.php.net/diff.php/php-src/pear/scripts/pearcmd.php?r1=1.1.2.12&r2=1.1.2.13&ty=u
Index: php-src/pear/scripts/pearcmd.php
diff -u php-src/pear/scripts/pearcmd.php:1.1.2.12 php-src/pear/scripts/pearcmd.php:1.1.2.13
--- php-src/pear/scripts/pearcmd.php:1.1.2.12 Sat Mar 13 12:34:36 2004
+++ php-src/pear/scripts/pearcmd.php Tue Jun 8 13:56:45 2004
@@ -18,7 +18,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: pearcmd.php,v 1.1.2.12 2004/03/13 17:34:36 cellog Exp $
+// $Id: pearcmd.php,v 1.1.2.13 2004/06/08 17:56:45 cellog Exp $
ob_end_clean();
/**
@@ -48,9 +48,14 @@
$all_commands = PEAR_Command::getCommands();
$argv = Console_Getopt::readPHPArgv();
-$progname = basename($argv[0]);
-array_shift($argv);
-$options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV");
+/* $progname = basename($argv[0]); */
+$progname = 'pear';
+if (in_array('getopt2', get_class_methods('Console_Getopt'))) {
+ array_shift($argv);
+ $options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV");
+} else {
+ $options = Console_Getopt::getopt($argv, "c:C:d:D:Gh?sSqu:vV");
+}
if (PEAR::isError($options)) {
usage($options);
}
@@ -157,8 +162,13 @@
$short_args = $long_args = null;
PEAR_Command::getGetoptArgs($command, $short_args, $long_args);
- array_shift($options[1]);
- if (PEAR::isError($tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args))) {
+ if (in_array('getopt2', get_class_methods('Console_Getopt'))) {
+ array_shift($options[1]);
+ $tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args);
+ } else {
+ $tmp = Console_Getopt::getopt($options[1], $short_args, $long_args);
+ }
+ if (PEAR::isError($tmp)) {
break;
}
list($tmpopt, $params) = $tmp;
@@ -260,7 +270,7 @@
return "$progname $command [options] $help[0]\n$help[1]";
}
}
- return "No such command";
+ return "Command '$command' is not valid, try 'pear help'";
}
// }}}