From f40007a1efc3d3c7553d4169ff1f426a478f2450 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Sat, 23 Mar 2002 16:50:43 +0000 Subject: [PATCH] - Use getenv('TERM') instead of $_ENV (empty for me in 4.1.1) - Added 'linux' as bold capable list of term types - Pass the col by reference for making the wrap take effect in tableRow --- pear/PEAR/Frontend/CLI.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index b818636f1e..fd7716aacd 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/pear/PEAR/Frontend/CLI.php @@ -16,7 +16,7 @@ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ - $Id$ + $Id$ */ require_once "PEAR.php"; @@ -39,13 +39,13 @@ class PEAR_Frontend_CLI extends PEAR function PEAR_Frontend_CLI() { parent::PEAR(); - - if (isset($_ENV['TERM'])) { + $term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1 + if ($term) { // XXX can use ncurses extension here, if available - if (preg_match('/^(xterm|vt220)/', $_ENV['TERM'])) { + if (preg_match('/^(xterm|vt220|linux)/', $term)) { $this->term['bold'] = sprintf("%c%c%c%c", 27, 91, 49, 109); $this->term['normal']=sprintf("%c%c%c", 27, 91, 109); - } elseif (preg_match('/^vt100/', $_ENV['TERM'])) { + } elseif (preg_match('/^vt100/', $term)) { $this->term['bold'] = sprintf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); $this->term['normal']=sprintf("%c%c%c%c%c", 27, 91, 109, 0, 0); } @@ -150,7 +150,7 @@ class PEAR_Frontend_CLI extends PEAR { $highest = 1; for ($i = 0; $i < sizeof($columns); $i++) { - $col = $columns[$i]; + $col = &$columns[$i]; if (isset($colparams[$i]) && !empty($colparams[$i]['wrap'])) { $col = wordwrap($col, $colparams[$i]['wrap'], "\n", 1); } @@ -265,7 +265,7 @@ class PEAR_Frontend_CLI extends PEAR // add bold escape characters to $cell $cell .= str_repeat(' ', $w - $l); } - + $rowtext .= $cellstart . $cell . $cellend; } $rowtext .= $rowend; -- 2.40.0