From: Stig Bakken Date: Fri, 22 Mar 2002 12:45:41 +0000 (+0000) Subject: * use PEAR_Frontend tables in config-show command X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75f15860b1333f3353587e5855866bbd381c7faa;p=php * use PEAR_Frontend tables in config-show command --- diff --git a/pear/PEAR/Command/Config.php b/pear/PEAR/Command/Config.php index 71009bc16c..d1a2109468 100644 --- a/pear/PEAR/Command/Config.php +++ b/pear/PEAR/Command/Config.php @@ -66,25 +66,28 @@ class PEAR_Command_Config extends PEAR_Command_Common switch ($command) { case 'config-show': { $keys = $cf->getKeys(); + sort($keys); + $this->ui->startTable(array('caption' => 'Configuration:')); if (isset($params[0]) && $cf->isDefined($params[0])) { foreach ($keys as $key) { $type = $cf->getType($key); - if ($type == 'password') { - $this->ui->displayLine("$key = ********"); - } else { - $this->ui->displayLine("$key = " . $cf->get($key, $params[0])); + $value = $cf->get($key, $params[0]); + if ($type == 'password' && $value) { + $value = '********'; } + $this->ui->tableRow(array($key, $value)); } } else { foreach ($keys as $key) { $type = $cf->getType($key); - if ($type == 'password') { - $this->ui->displayLine("$key = ********"); - } else { - $this->ui->displayLine("$key = " . $cf->get($key)); + $value = $cf->get($key, $params[0]); + if ($type == 'password' && $value) { + $value = '********'; } + $this->ui->tableRow(array($key, $value)); } } + $this->ui->endTable(); break; } case 'config-get': {