From 90146bca858a41ab556d1d6dab428ddd5133b532 Mon Sep 17 00:00:00 2001 From: Christian Dickmann Date: Thu, 30 May 2002 10:14:57 +0000 Subject: fix a typo. add some information to config-show --- pear/PEAR/Command/Config.php | 2 +- pear/PEAR/Command/Remote.php | 15 ++++++++++++--- pear/PEAR/Frontend/CLI.php | 14 +++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pear/PEAR/Command/Config.php b/pear/PEAR/Command/Config.php index 98098a53cb..5b7675faf5 100644 --- a/pear/PEAR/Command/Config.php +++ b/pear/PEAR/Command/Config.php @@ -104,7 +104,7 @@ in. The default layer is "user". } elseif ($value === true) { $value = 'true'; } - $data['data'][] = array($key, $value); + $data['data'][$this->config->getGroup($key)][] = array($this->config->getPrompt($key) , $key, $value); } $this->ui->outputData($data, $command); return true; diff --git a/pear/PEAR/Command/Remote.php b/pear/PEAR/Command/Remote.php index 90df1c8974..f6b14881da 100644 --- a/pear/PEAR/Command/Remote.php +++ b/pear/PEAR/Command/Remote.php @@ -96,11 +96,21 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', // }}} - // {{{ info-remote + // {{{ remote-info - function doInfoRemote($command, $options, $params) + function doRemoteInfo($command, $options, $params) { return false; // coming soon + var_dump($params[0]); + $r = new PEAR_Remote($this->config); + $info = $r->call('package.info', $params[0]); + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + var_dump($info); + + return false; // coming soon } // }}} @@ -140,7 +150,6 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', if (PEAR::isError($available)) { return $this->raiseError($available); } - $i = $j = 0; $data = array( 'caption' => 'All packages:', 'border' => true, diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index c829937812..aca8050654 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/pear/PEAR/Frontend/CLI.php @@ -378,6 +378,18 @@ class PEAR_Frontend_CLI extends PEAR }; $this->_endTable(); break; + case 'config-show': + $this->_startTable($data); + if (isset($data['headline']) && is_array($data['headline'])) + $this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); + + foreach($data['data'] as $group) { + foreach($group as $value) { + $this->_tableRow($value, null, array(1 => array('wrap' => 55))); + } + }; + $this->_endTable(); + break; default: if (is_array($data)) { @@ -397,7 +409,7 @@ class PEAR_Frontend_CLI extends PEAR function log($text) { - return $this->displayLine($text); + return $this->_displayLine($text); } // {{{ bold($text) -- cgit v1.2.1