From: Markus Fischer Date: Sun, 14 Apr 2002 13:34:52 +0000 (+0000) Subject: - Do not try to draw a table if there are not elements. X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~652 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f95fbc4e60ec327ce1f200858ff1af1c07fdfa4e;p=php - Do not try to draw a table if there are not elements. # If no packages are installed, until now the output was: # # INSTALLED PACKAGES: # =================== # + # + # # Now it is: # # INSTALLED PACKAGES: # =================== # # Which is nicer IMHO. It think keeping the caption is ok. --- diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index a5e05bfc54..f8e928a463 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/pear/PEAR/Frontend/CLI.php @@ -223,6 +223,9 @@ class PEAR_Frontend_CLI extends PEAR if (!empty($caption)) { $this->displayHeading($caption); } + if (count($table_data) == 0) { + return; + } if (!isset($width)) { $width = $widest; } else { @@ -316,4 +319,4 @@ class PEAR_Frontend_CLI extends PEAR // }}} } -?> \ No newline at end of file +?>