summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pear/scripts/pear-get.in12
-rw-r--r--pear/scripts/pear.in10
2 files changed, 11 insertions, 11 deletions
diff --git a/pear/scripts/pear-get.in b/pear/scripts/pear-get.in
index 8d349376e1..49cd284003 100644
--- a/pear/scripts/pear-get.in
+++ b/pear/scripts/pear-get.in
@@ -46,17 +46,17 @@ require_once 'Console/Getopt.php';
error_reporting(E_ALL & ~E_NOTICE);
-PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");
-
-// {{{ config file and option parsing
-if (!isset($argv)) {
- die("Could not read cmd args (register_argc_argv=Off?)\n");
+$argv = Console_Getopt::readPHPArgv();
+if (PEAR::isError($argv)) {
+ die($argv->getMessage());
}
-$options = Console_Getopt::getopt($argv, "c:C:d:D:h?qu:v");
+$options = Console_Getopt::getopt($argv, "c:C:d:D:h?sSqu:v");
if (PEAR::isError($options)) {
usage($options);
}
+PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");
+
if (OS_WINDOWS) {
$pear_default_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pearsys.ini';
$pear_user_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pear.ini';
diff --git a/pear/scripts/pear.in b/pear/scripts/pear.in
index e093709efd..0791419b3b 100644
--- a/pear/scripts/pear.in
+++ b/pear/scripts/pear.in
@@ -49,17 +49,17 @@ require_once 'Console/Getopt.php';
error_reporting(E_ALL & ~E_NOTICE);
-PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");
-
-// {{{ config file and option parsing
-if (!isset($argv)) {
- die("Could not read cmd args (register_argc_argv=Off?)\n");
+$argv = Console_Getopt::readPHPArgv();
+if (PEAR::isError($argv)) {
+ die($argv->getMessage());
}
$options = Console_Getopt::getopt($argv, "c:C:d:D:h?sSqu:v");
if (PEAR::isError($options)) {
usage($options);
}
+PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");
+
if (OS_WINDOWS) {
$pear_default_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pearsys.ini';
$pear_user_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pear.ini';