]> granicus.if.org Git - php/commitdiff
* use PEAR_Frontend tables in config-show command
authorStig Bakken <ssb@php.net>
Fri, 22 Mar 2002 12:45:41 +0000 (12:45 +0000)
committerStig Bakken <ssb@php.net>
Fri, 22 Mar 2002 12:45:41 +0000 (12:45 +0000)
pear/PEAR/Command/Config.php

index 71009bc16cf8f246041c91c16f4d8886a0f2758c..d1a210946830d52d4d49f5a6e2e2905737341d8d 100644 (file)
@@ -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': {