]> granicus.if.org Git - php/commitdiff
* import PEAR 1.0.1
authorStig Bakken <ssb@php.net>
Sat, 15 Feb 2003 20:28:54 +0000 (20:28 +0000)
committerStig Bakken <ssb@php.net>
Sat, 15 Feb 2003 20:28:54 +0000 (20:28 +0000)
13 files changed:
pear/OS/Guess.php
pear/PEAR.php
pear/PEAR/Command/Config.php
pear/PEAR/Command/Package.php
pear/PEAR/Command/Remote.php
pear/PEAR/Config.php
pear/PEAR/Frontend/CLI.php
pear/PEAR/Remote.php
pear/System.php
pear/package-PEAR.xml
pear/package.dtd
pear/scripts/pear.bat
pear/scripts/pear.in

index 2cb218db179d9bd99af3742b9a6bea7d05209102..8e28e4f3be13327786a58a684c7d11675dd0fdcd 100644 (file)
 
 // }}}
 
+/* TODO:
+ * - define endianness, to allow matchSignature("bigend") etc.
+ */
+
 class OS_Guess
 {
     var $sysname;
@@ -209,4 +213,4 @@ class OS_Guess
  * c-basic-offset: 4
  * End:
  */
-?>
\ No newline at end of file
+?>
index 7fa35a8495d4dadb3157bc3d87328322d925ba07..7f034b7b0a9952e535e92acc1409a54f0cbdaeda 100644 (file)
@@ -670,11 +670,7 @@ class PEAR_Error
     var $code                 = -1;
     var $message              = '';
     var $userinfo             = '';
-
-    // Wait until we have a stack-groping function in PHP.
-    //var $file    = '';
-    //var $line    = 0;
-
+    var $backtrace            = null;
 
     // }}}
     // {{{ constructor
@@ -709,6 +705,9 @@ class PEAR_Error
         $this->code      = $code;
         $this->mode      = $mode;
         $this->userinfo  = $userinfo;
+        if (function_exists("debug_backtrace")) {
+            $this->backtrace = debug_backtrace();
+        }
         if ($mode & PEAR_ERROR_CALLBACK) {
             $this->level = E_USER_NOTICE;
             $this->callback = $options;
@@ -853,6 +852,25 @@ class PEAR_Error
         return $this->getUserInfo();
     }
 
+    // }}}
+    // {{{ getBacktrace()
+
+    /**
+     * Get the call backtrace from where the error was generated.
+     * Supported with PHP 4.3.0 or newer.
+     *
+     * @param int $frame (optional) what frame to fetch
+     * @return array Backtrace, or NULL if not available.
+     * @access public
+     */
+    function getBacktrace($frame = null)
+    {
+        if ($frame === null) {
+            return $this->backtrace;
+        }
+        return $this->backtrace[$frame];
+    }
+
     // }}}
     // {{{ addUserInfo()
 
index abe8b93101de756ac36be098e990d47af16ebf89..762ad31e2cd58cd0b9bbece881ad43a3a7262a8d 100644 (file)
@@ -222,4 +222,4 @@ displays help for all configuration parameters.
     // }}}
 }
 
-?>
+?>
\ No newline at end of file
index 1d532e98568b59dc3041da210b6a9fc76e142e2c..cba77138de4c7445c6776fa5626d90189f5a28b6 100644 (file)
@@ -52,6 +52,69 @@ package.xml).
             'shortcut' => 'pv',
             'options' => array(),
             'doc' => '
+',
+            ),
+        'cvsdiff' => array(
+            'summary' => 'Run a "cvs diff" for all files in a package',
+            'function' => 'doCvsDiff',
+            'shortcut' => 'cd',
+            'options' => array(
+                'quiet' => array(
+                    'shortopt' => 'q',
+                    'doc' => 'Be quiet',
+                    ),
+                'reallyquiet' => array(
+                    'shortopt' => 'Q',
+                    'doc' => 'Be really quiet',
+                    ),
+                'date' => array(
+                    'shortopt' => 'D',
+                    'doc' => 'Diff against revision of DATE',
+                    'arg' => 'DATE',
+                    ),
+                'release' => array(
+                    'shortopt' => 'R',
+                    'doc' => 'Diff against tag for package release REL',
+                    'arg' => 'REL',
+                    ),
+                'revision' => array(
+                    'shortopt' => 'r',
+                    'doc' => 'Diff against revision REV',
+                    'arg' => 'REV',
+                    ),
+                'context' => array(
+                    'shortopt' => 'c',
+                    'doc' => 'Generate context diff',
+                    ),
+                'unified' => array(
+                    'shortopt' => 'u',
+                    'doc' => 'Generate unified diff',
+                    ),
+                'ignore-case' => array(
+                    'shortopt' => 'i',
+                    'doc' => 'Ignore case, consider upper- and lower-case letters equivalent',
+                    ),
+                'ignore-whitespace' => array(
+                    'shortopt' => 'b',
+                    'doc' => 'Ignore changes in amount of white space',
+                    ),
+                'ignore-blank-lines' => array(
+                    'shortopt' => 'B',
+                    'doc' => 'Ignore changes that insert or delete blank lines',
+                    ),
+                'brief' => array(
+                    'doc' => 'Report only whether the files differ, no details',
+                    ),
+                'dry-run' => array(
+                    'shortopt' => 'n',
+                    'doc' => 'Don\'t do anything, just pretend',
+                    ),
+                ),
+            'doc' => '<package.xml>
+Compares all the files in a package.  Without any options, this
+command will compare the current code with the last checked-in code.
+Using the -r or -R option you may compare the current code with that
+of a specific release.
 ',
             ),
         'cvstag' => array(
@@ -75,8 +138,12 @@ package.xml).
                     'shortopt' => 'd',
                     'doc' => 'Remove tag',
                     ),
+                'dry-run' => array(
+                    'shortopt' => 'n',
+                    'doc' => 'Don\'t do anything, just pretend',
+                    ),
                 ),
-            'doc' => '
+            'doc' => '<package.xml>
 Sets a CVS tag on all files in a package.  Use this command after you have
 packaged a distribution tarball with the "package" command to tag what
 revisions of what files were in that release.  If need to fix something
@@ -294,8 +361,11 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
         foreach ($files as $file) {
             $command .= ' ' . escapeshellarg($file);
         }
+        if ($this->config->get('verbose') > 1) {
+            $this->output .= "+ $command\n";
+        }
         $this->output .= "+ $command\n";
-        if (empty($options['n'])) {
+        if (empty($options['dry-run'])) {
             $fp = popen($command, "r");
             while ($line = fgets($fp, 1024)) {
                 $this->output .= rtrim($line)."\n";
@@ -306,6 +376,69 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
         return true;
     }
 
+    // }}}
+    // {{{ doCvsDiff()
+
+    function doCvsDiff($command, $options, $params)
+    {
+        $this->output = '';
+        if (sizeof($params) < 1) {
+            $help = $this->getHelp($command);
+            return $this->raiseError("$command: missing parameter: $help[0]");
+        }
+        $obj = new PEAR_Common;
+        $info = $obj->infoFromDescriptionFile($params[0]);
+        if (PEAR::isError($info)) {
+            return $this->raiseError($info);
+        }
+        $files = array_keys($info['filelist']);
+        $cmd = "cvs";
+        if (isset($options['quiet'])) {
+            $cmd .= ' -q';
+            unset($options['quiet']);
+        }
+        if (isset($options['reallyquiet'])) {
+            $cmd .= ' -Q';
+            unset($options['reallyquiet']);
+        }
+        if (isset($options['release'])) {
+            $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $options['release']);
+            $cvstag = "RELEASE_$cvsversion";
+            $options['revision'] = $cvstag;
+            unset($options['release']);
+        }
+        $execute = true;
+        if (isset($options['dry-run'])) {
+            $execute = false;
+            unset($options['dry-run']);
+        }
+        $cmd .= ' diff';
+        // the rest of the options are passed right on to "cvs diff"
+        foreach ($options as $option => $optarg) {
+            $arg = @$this->commands[$command]['options'][$option]['arg'];
+            $short = @$this->commands[$command]['options'][$option]['shortopt'];
+            $cmd .= $short ? " -$short" : " --$option";
+            if ($arg && $optarg) {
+                $cmd .= ($short ? '' : '=') . escapeshellarg($optarg);
+            }
+        }
+        foreach ($files as $file) {
+            $cmd .= ' ' . escapeshellarg($file);
+        }
+        if ($this->config->get('verbose') > 1) {
+            $this->output .= "+ $cmd\n";
+        }
+        if ($execute) {
+            $fp = popen($cmd, "r");
+            while ($line = fgets($fp, 1024)) {
+                $this->output .= rtrim($line)."\n";
+            }
+            pclose($fp);
+        }
+        $this->ui->outputData($this->output, $command);
+        return true;
+    }
+
     // }}}
     // {{{ doRunTests()
 
index 9dec810bacae551573d3ec15e02a7fd112b853e1..2142037c8a85295540f34445e6f04bf860c33e61 100644 (file)
@@ -88,6 +88,16 @@ Download a package tarball.  The file will be named as suggested by the
 server, for example if you download the DB package and the latest stable
 version of DB is 1.2, the downloaded file will be DB-1.2.tgz.',
             ),
+        'clear-cache' => array(
+            'summary' => 'Clear XML-RPC Cache',
+            'function' => 'doClearCache',
+            'shortcut' => 'cc',
+            'options' => array(),
+            'doc' => '
+Clear the XML-RPC cache.  See also the cache_ttl configuration
+parameter.
+',
+            ),
         );
 
     // }}}
@@ -354,6 +364,43 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.',
         return true;
     }
 
+    // }}}
+    // {{{ doClearCache()
+
+    function doClearCache($command, $options, $params)
+    {
+        $cache_dir = $this->config->get('cache_dir');
+        $verbose = $this->config->get('verbose');
+        $output = '';
+        if (!($dp = @opendir($cache_dir))) {
+            return $this->raiseError("opendir($cache_dir) failed: $php_errormsg");
+        }
+        if ($verbose >= 1) {
+            $output .= "reading directory $cache_dir\n";
+        }
+        $num = 0;
+        while ($ent = readdir($dp)) {
+            if (preg_match('/^xmlrpc_cache_[a-z0-9]{32}$/', $ent)) {
+                $path = $cache_dir . DIRECTORY_SEPARATOR . $ent;
+                $ok = @unlink($path);
+                if ($ok) {
+                    if ($verbose >= 2) {
+                        $output .= "deleted $path\n";
+                    }
+                    $num++;
+                } elseif ($verbose >= 1) {
+                    $output .= "failed to delete $path\n";
+                }
+            }
+        }
+        closedir($dp);
+        if ($verbose >= 1) {
+            $output .= "$num cache entries cleared\n";
+        }
+        $this->ui->outputData(rtrim($output), $command);
+        return $num;
+    }
+
     // }}}
 }
 
index 2e3d667fce29c2cc8068211da3490fbbf1a7e59a..8f5f1f39ccf6c0067a12483d7d0d905fc97320ef 100644 (file)
@@ -33,33 +33,33 @@ $GLOBALS['_PEAR_Config_instance'] = null;
 // PHP_ prefix is for some security, PHP protects environment
 // variables starting with PHP_*.
 
-if (isset($_ENV['PHP_PEAR_SYSCONF_DIR'])) {
-    define('PEAR_CONFIG_SYSCONFDIR', $_ENV['PHP_PEAR_SYSCONF_DIR']);
-} elseif (isset($_ENV['SystemRoot'])) {
-    define('PEAR_CONFIG_SYSCONFDIR', $_ENV['SystemRoot']);
-} elseif (@is_dir(PHP_SYSCONFDIR)) {
+if (getenv('PHP_PEAR_SYSCONF_DIR')) {
+    define('PEAR_CONFIG_SYSCONFDIR', getenv('PHP_PEAR_SYSCONF_DIR'));
+} elseif (getenv('SystemRoot')) {
+    define('PEAR_CONFIG_SYSCONFDIR', getenv('SystemRoot'));
+} else {
     define('PEAR_CONFIG_SYSCONFDIR', PHP_SYSCONFDIR);
 }
 
 // Default for master_server
-if (isset($_ENV['PHP_PEAR_MASTER_SERVER'])) {
-    define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', $_ENV['PHP_PEAR_MASTER_SERVER']);
+if (getenv('PHP_PEAR_MASTER_SERVER')) {
+    define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', getenv('PHP_PEAR_MASTER_SERVER'));
 } else {
     define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', 'pear.php.net');
 }
 
 // Default for http_proxy
-if (isset($_ENV['PHP_PEAR_HTTP_PROXY'])) {
-    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', $_ENV['PHP_PEAR_HTTP_PROXY']);
-} elseif (isset($_ENV['http_proxy'])) {
-    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', $_ENV['http_proxy']);
+if (getenv('PHP_PEAR_HTTP_PROXY')) {
+    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', getenv('PHP_PEAR_HTTP_PROXY'));
+} elseif (getenv('http_proxy')) {
+    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', getenv('http_proxy'));
 } else {
     define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', '');
 }
 
 // Default for php_dir
-if (isset($_ENV['PHP_PEAR_INSTALL_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_PHP_DIR', $_ENV['PHP_PEAR_INSTALL_DIR']);
+if (getenv('PHP_PEAR_INSTALL_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_PHP_DIR', getenv('PHP_PEAR_INSTALL_DIR'));
 } else {
     if (@is_dir(PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'lib')) {
         define('PEAR_CONFIG_DEFAULT_PHP_DIR',
@@ -70,46 +70,46 @@ if (isset($_ENV['PHP_PEAR_INSTALL_DIR'])) {
 }
 
 // Default for ext_dir
-if (isset($_ENV['PHP_PEAR_EXTENSION_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_EXT_DIR', $_ENV['PHP_PEAR_EXTENSION_DIR']);
+if (getenv('PHP_PEAR_EXTENSION_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir'));
 }
 
 // Default for doc_dir
-if (isset($_ENV['PHP_PEAR_DOC_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_DOC_DIR', $_ENV['PHP_PEAR_DOC_DIR']);
+if (getenv('PHP_PEAR_DOC_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_DOC_DIR', getenv('PHP_PEAR_DOC_DIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_DOC_DIR',
            PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'docs');
 }
 
 // Default for bin_dir
-if (isset($_ENV['PHP_PEAR_BIN_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_BIN_DIR', $_ENV['PHP_PEAR_BIN_DIR']);
+if (getenv('PHP_PEAR_BIN_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_BIN_DIR', getenv('PHP_PEAR_BIN_DIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_BIN_DIR', PHP_BINDIR);
 }
 
 // Default for data_dir
-if (isset($_ENV['PHP_PEAR_DATA_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_DATA_DIR', $_ENV['PHP_PEAR_DATA_DIR']);
+if (getenv('PHP_PEAR_DATA_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_DATA_DIR', getenv('PHP_PEAR_DATA_DIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_DATA_DIR',
            PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'data');
 }
 
 // Default for test_dir
-if (isset($_ENV['PHP_PEAR_TEST_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_TEST_DIR', $_ENV['PHP_PEAR_TEST_DIR']);
+if (getenv('PHP_PEAR_TEST_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_TEST_DIR', getenv('PHP_PEAR_TEST_DIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_TEST_DIR',
            PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'tests');
 }
 
 // Default for cache_dir
-if (isset($_ENV['PHP_PEAR_CACHE_DIR'])) {
-    define('PEAR_CONFIG_DEFAULT_CACHE_DIR', $_ENV['PHP_PEAR_CACHE_DIR']);
+if (getenv('PHP_PEAR_CACHE_DIR')) {
+    define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_CACHE_DIR',
            System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
@@ -117,51 +117,51 @@ if (isset($_ENV['PHP_PEAR_CACHE_DIR'])) {
 }
 
 // Default for php_bin
-if (isset($_ENV['PHP_PEAR_PHP_BIN'])) {
-    define('PEAR_CONFIG_DEFAULT_PHP_BIN', $_ENV['PHP_PEAR_PHP_BIN']);
+if (getenv('PHP_PEAR_PHP_BIN')) {
+    define('PEAR_CONFIG_DEFAULT_PHP_BIN', getenv('PHP_PEAR_PHP_BIN'));
 } else {
     define('PEAR_CONFIG_DEFAULT_PHP_BIN', PEAR_CONFIG_DEFAULT_BIN_DIR.
            DIRECTORY_SEPARATOR.'php'.(OS_WINDOWS ? '.exe' : ''));
 }
 
 // Default for verbose
-if (isset($_ENV['PHP_PEAR_VERBOSE'])) {
-    define('PEAR_CONFIG_DEFAULT_VERBOSE', $_ENV['PHP_PEAR_VERBOSE']);
+if (getenv('PHP_PEAR_VERBOSE')) {
+    define('PEAR_CONFIG_DEFAULT_VERBOSE', getenv('PHP_PEAR_VERBOSE'));
 } else {
     define('PEAR_CONFIG_DEFAULT_VERBOSE', 1);
 }
 
 // Default for preferred_state
-if (isset($_ENV['PHP_PEAR_PREFERRED_STATE'])) {
-    define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', $_ENV['PHP_PEAR_PREFERRED_STATE']);
+if (getenv('PHP_PEAR_PREFERRED_STATE')) {
+    define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', getenv('PHP_PEAR_PREFERRED_STATE'));
 } else {
     define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', 'stable');
 }
 
 // Default for umask
-if (isset($_ENV['PHP_PEAR_UMASK'])) {
-    define('PEAR_CONFIG_DEFAULT_UMASK', $_ENV['PHP_PEAR_UMASK']);
+if (getenv('PHP_PEAR_UMASK')) {
+    define('PEAR_CONFIG_DEFAULT_UMASK', getenv('PHP_PEAR_UMASK'));
 } else {
-    define('PEAR_CONFIG_DEFAULT_UMASK', umask());
+    define('PEAR_CONFIG_DEFAULT_UMASK', decoct(umask()));
 }
 
 // Default for cache_ttl
-if (isset($_ENV['PHP_PEAR_CACHE_TTL'])) {
-    define('PEAR_CONFIG_DEFAULT_CACHE_TTL', $_ENV['PHP_PEAR_CACHE_TTL']);
+if (getenv('PHP_PEAR_CACHE_TTL')) {
+    define('PEAR_CONFIG_DEFAULT_CACHE_TTL', getenv('PHP_PEAR_CACHE_TTL'));
 } else {
     define('PEAR_CONFIG_DEFAULT_CACHE_TTL', 3600);
 }
 
 // Default for sig_type
-if (isset($_ENV['PHP_PEAR_SIG_TYPE'])) {
-    define('PEAR_CONFIG_DEFAULT_SIG_TYPE', $_ENV['PHP_PEAR_SIG_TYPE']);
+if (getenv('PHP_PEAR_SIG_TYPE')) {
+    define('PEAR_CONFIG_DEFAULT_SIG_TYPE', getenv('PHP_PEAR_SIG_TYPE'));
 } else {
     define('PEAR_CONFIG_DEFAULT_SIG_TYPE', 'gpg');
 }
 
 // Default for sig_bin
-if (isset($_ENV['PHP_PEAR_SIG_BIN'])) {
-    define('PEAR_CONFIG_DEFAULT_SIG_BIN', $_ENV['PHP_PEAR_SIG_BIN']);
+if (getenv('PHP_PEAR_SIG_BIN')) {
+    define('PEAR_CONFIG_DEFAULT_SIG_BIN', getenv('PHP_PEAR_SIG_BIN'));
 } else {
     define('PEAR_CONFIG_DEFAULT_SIG_BIN',
            System::which(
@@ -169,8 +169,8 @@ if (isset($_ENV['PHP_PEAR_SIG_BIN'])) {
 }
 
 // Default for sig_keydir
-if (isset($_ENV['PHP_PEAR_SIG_KEYDIR'])) {
-    define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR', $_ENV['PHP_PEAR_SIG_KEYDIR']);
+if (getenv('PHP_PEAR_SIG_KEYDIR')) {
+    define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR', getenv('PHP_PEAR_SIG_KEYDIR'));
 } else {
     define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR',
            PEAR_CONFIG_SYSCONFDIR . DIRECTORY_SEPARATOR . 'pearkeys');
index 14ea336418b1dcb949a7099db47a20f2017666a1..2e84eb9e00a057ace52b4cffad08ff838b40e5bf 100644 (file)
@@ -33,7 +33,6 @@ class PEAR_Frontend_CLI extends PEAR
     var $type = 'CLI';
     var $lp = ''; // line prefix
 
-    var $omode = 'plain';
     var $params = array();
     var $term = array(
         'bold' => '',
@@ -68,7 +67,7 @@ class PEAR_Frontend_CLI extends PEAR
 
     function displayLine($text)
     {
-        trigger_error("Frontend::displayLine deprecated", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::displayLine deprecated", E_USER_ERROR);
     }
 
     function _displayLine($text)
@@ -81,7 +80,7 @@ class PEAR_Frontend_CLI extends PEAR
 
     function display($text)
     {
-        trigger_error("Frontend::display deprecated", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::display deprecated", E_USER_ERROR);
     }
 
     function _display($text)
@@ -111,7 +110,7 @@ class PEAR_Frontend_CLI extends PEAR
 
     function displayHeading($title)
     {
-        trigger_error("Frontend::displayHeading deprecated", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::displayHeading deprecated", E_USER_ERROR);
     }
 
     function _displayHeading($title)
@@ -160,7 +159,7 @@ class PEAR_Frontend_CLI extends PEAR
 
     function userConfirm($prompt, $default = 'yes')
     {
-        trigger_error("Frontend::userConfirm not yet converted", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::userConfirm not yet converted", E_USER_ERROR);
         static $positives = array('y', 'yes', 'on', '1');
         static $negatives = array('n', 'no', 'off', '0');
         print "$this->lp$prompt [$default] : ";
@@ -188,12 +187,11 @@ class PEAR_Frontend_CLI extends PEAR
 
     function startTable($params = array())
     {
-        trigger_error("Frontend::startTable deprecated", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::startTable deprecated", E_USER_ERROR);
     }
 
     function _startTable($params = array())
     {
-        $this->omode = 'table';
         $params['table_data'] = array();
         $params['widest'] = array();  // indexed by column
         $params['highest'] = array(); // indexed by row
@@ -206,7 +204,7 @@ class PEAR_Frontend_CLI extends PEAR
 
     function tableRow($columns, $rowparams = array(), $colparams = array())
     {
-        trigger_error("Frontend::tableRow deprecated", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::tableRow deprecated", E_USER_ERROR);
     }
 
     function _tableRow($columns, $rowparams = array(), $colparams = array())
@@ -256,12 +254,11 @@ class PEAR_Frontend_CLI extends PEAR
 
     function endTable()
     {
-        trigger_error("Frontend::tableRow deprecated", E_USER_ERROR);
+        trigger_error("PEAR_Frontend_CLI::tableRow deprecated", E_USER_ERROR);
     }
 
     function _endTable()
     {
-        $this->omode = '';
         extract($this->params);
         if (!empty($caption)) {
             $this->_displayHeading($caption);
index c85a682ec7cbb188fd3fac30ce6785730f1ec18c..3095d74c6203825c80e52dfd4c7cd0fefff0b503 100644 (file)
@@ -58,7 +58,7 @@ class PEAR_Remote extends PEAR
         if (!file_exists($cachedir)) {
             System::mkdir('-p '.$cachedir);
         }
-        $filename = $cachedir.'/xmlrpc_cache_'.$id;
+        $filename = $cachedir . DIRECTORY_SEPARATOR . 'xmlrpc_cache_' . $id;
         if (!file_exists($filename)) {
             return null;
         };
@@ -313,16 +313,16 @@ class PEAR_Remote extends PEAR
                 $lastkey = key($php_val);
                 if ($firstkey === 0 && is_int($lastkey) &&
                     ($lastkey + 1) == count($php_val)) {
-                    $is_continous = true;
+                    $is_continuous = true;
                     reset($php_val);
                     $size = count($php_val);
                     for ($expect = 0; $expect < $size; $expect++, next($php_val)) {
                         if (key($php_val) !== $expect) {
-                            $is_continous = false;
+                            $is_continuous = false;
                             break;
                         }
                     }
-                    if ($is_continous) {
+                    if ($is_continuous) {
                         reset($php_val);
                         $arr = array();
                         while (list($k, $v) = each($php_val)) {
@@ -332,7 +332,7 @@ class PEAR_Remote extends PEAR
                         break;
                     }
                 }
-                // fall though if not numerical and continous
+                // fall though if not numerical and continuous
             case "object":
                 $arr = array();
                 while (list($k, $v) = each($php_val)) {
index e9341b3db614f595a004f3c196ca0e111a745460..98754e9e1729a35c2ea647f8fc0fd29351986d59 100644 (file)
@@ -433,15 +433,17 @@ class System
 
         // XXX FIXME honor safe mode
         $path_delim = OS_WINDOWS ? ';' : ':';
-        $exe_suffix = OS_WINDOWS ? '.exe' : '';
+        $exe_suffixes = OS_WINDOWS ? array('.exe','.bat','.cmd','.com') : array('');
         $path_elements = explode($path_delim, getenv('PATH'));
-        foreach ($path_elements as $dir) {
-            $file = $dir . DIRECTORY_SEPARATOR . $program . $exe_suffix;
-            if (@is_file($file) && @$pear_is_executable($file)) {
-                return $file;
+        foreach ($exe_suffixes as $suff) {
+            foreach ($path_elements as $dir) {
+                $file = $dir . DIRECTORY_SEPARATOR . $program . $suff;
+                if (@is_file($file) && @$pear_is_executable($file)) {
+                    return $file;
+                }
             }
         }
         return $fallback;
     }
 }
-?>
\ No newline at end of file
+?>
index 6324d7267491751606e39a040a6faffcfb9a2541..a3cdf6bb1a9f577345b66eb3058c4659cf472058 100644 (file)
     </maintainer>
   </maintainers>
   <release>
-    <version>1.0b3</version>
+    <version>1.0.1</version>
     <state>stable</state>
-    <date>2002-12-13</date>
+    <date>2003-01-10</date>
     <notes>
-* fixed "info" shortcut (conflicted with "install")
-* added "php_bin" config parameter
-* all "non-personal" config parameters now use
-  environment variables for defaults (very useful
-  to override the default php_dir on Windows!)
+* PEAR_Error class has call backtrace available by
+  calling getBacktrace().  Available if used with
+  PHP 4.3 or newer.
+
+* PEAR_Config class uses getenv() rather than $_ENV
+  to read environment variables.
+
+* System::which() Windows fix, now looks for
+  exe/bat/cmd/com suffixes rather than just exe
+
+* Added "pear cvsdiff" command
+
+* Windows output buffering bugfix for "pear" command
 </notes>
     <filelist>
       <file role="data" name="package.dtd"/>
     </deps>
   </release>
   <changelog>
+   <release>
+     <version>1.0</version>
+     <state>stable</state>
+     <date>2002-12-27</date>
+     <notes>
+ * set default cache_ttl to 1 hour
+ * added "clear-cache" command
+ </notes>
+     <deps>
+       <dep type="php" rel="ge" version="4.1"/>
+       <dep type="pkg" rel="ge" version="0.4">Archive_Tar</dep>
+       <dep type="pkg" rel="ge" version="0.11">Console_Getopt</dep>
+     </deps>
+   </release>
+   <release>
+     <version>1.0b3</version>
+     <state>stable</state>
+     <date>2002-12-13</date>
+     <notes>
+ * fixed "info" shortcut (conflicted with "install")
+ * added "php_bin" config parameter
+ * all "non-personal" config parameters now use
+   environment variables for defaults (very useful
+   to override the default php_dir on Windows!)
+ </notes>
+     <deps>
+       <dep type="php" rel="ge" version="4.1"/>
+       <dep type="pkg" rel="ge" version="0.4">Archive_Tar</dep>
+       <dep type="pkg" rel="ge" version="0.11">Console_Getopt</dep>
+     </deps>
+   </release>
    <release>
      <version>1.0b2</version>
      <state>stable</state>
index 340c22a08ec5a257e75e2c1b008a2fe6ef69effc..265bbdf017eaeb63731f850cd6d4260ff72c7f9b 100644 (file)
@@ -1,10 +1,10 @@
 <!--
-     $Id: package.dtd,v 1.27.4.2 2002-12-13 02:14:22 ssb Exp $
+     $Id: package.dtd,v 1.27.4.3 2003-02-15 20:28:50 ssb Exp $
 
-     This is the PEAR package description, version 1.0b9.
+     This is the PEAR package description, version 1.0.
      It should be used with the informal public identifier:
 
-         "-//PHP Group//DTD PEAR Package 1.0b10//EN//XML"
+         "-//PHP Group//DTD PEAR Package 1.0//EN//XML"
 
      Copyright (c) 1997-2002 The PHP Group             
 
index 9d2a18ce6f49bed9d103fd58b2ad093360fad705..450bdc9954969ba436ef7db2ddc88bee5c83fa1b 100755 (executable)
@@ -16,7 +16,7 @@ REM ----------------------------------------------------------------------
 REM  Authors:     Alexander Merz (alexmerz@php.net)
 REM ----------------------------------------------------------------------
 REM
-REM  $Id: pear.bat,v 1.11 2002/12/13 02:10:23 ssb Exp $
+REM  $Id: pear.bat,v 1.12 2003/01/03 00:17:41 phanto Exp $
 
 REM change this lines to match the paths of your system
 REM -------------------
@@ -25,5 +25,5 @@ set PHP_BIN=@php_bin@
 set BIN_DIR=@bin_dir@
 set PEAR_PATH=@include_path@
 
-%PHP_BIN% -C -d output_buffer=1 -d include_path=%PEAR_PATH% -f %BIN_DIR%\pear -- %1 %2 %3 %4 %5 %6 %7 %8 %9
+%PHP_BIN% -C -d output_buffering=1 -d include_path=%PEAR_PATH% -f %BIN_DIR%\pear -- %1 %2 %3 %4 %5 %6 %7 %8 %9
 @ECHO ON
index 5677142f4c45c9e2af4b163b158b3ea744699028..cd6736b43c4b30928b0609eaeeba25c66ce0b985 100644 (file)
@@ -1,7 +1,28 @@
 #!/bin/sh
-PHP="@php_bin@"
-test "$PHP" = '@'php_bin'@' && PHP=php
-exec $PHP -C -q -d output_buffering=1 $0 $@
+
+# first find which PHP binary to use
+if test "x$PHP_PEAR_PHP_BIN" != "x"; then
+  PHP="$PHP_PEAR_PHP_BIN"
+else
+  if test "@php_bin@" = '@'php_bin'@'; then
+    PHP=php
+  else
+    PHP="@php_bin@"
+  fi
+fi
+
+# then look for the right pear include dir
+if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
+  INC="-d include_path=$PHP_PEAR_INSTALL_DIR"
+else
+  if test "@php_dir@" = '@'php_dir'@'; then
+    INC=""
+  else
+    INC="-d include_path=@php_dir@"
+  fi
+fi
+
+exec $PHP -C -q $INC -d output_buffering=1 $0 $@
 <?php
 //
 // +----------------------------------------------------------------------+