diff options
| author | Stig Bakken <ssb@php.net> | 2002-03-22 12:45:41 +0000 |
|---|---|---|
| committer | Stig Bakken <ssb@php.net> | 2002-03-22 12:45:41 +0000 |
| commit | 75f15860b1333f3353587e5855866bbd381c7faa (patch) | |
| tree | 8ac9d08196728f6ac77e7221eece00a8f37f2da4 /pear/PEAR/Command/Config.php | |
| parent | fe614114e62292f0d3dfa94bece175775c34bcef (diff) | |
| download | php-git-75f15860b1333f3353587e5855866bbd381c7faa.tar.gz | |
* use PEAR_Frontend tables in config-show command
Diffstat (limited to 'pear/PEAR/Command/Config.php')
| -rw-r--r-- | pear/PEAR/Command/Config.php | 19 |
1 files changed, 11 insertions, 8 deletions
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': { |
