diff options
| author | Tomas V.V.Cox <cox@php.net> | 2002-03-23 16:50:43 +0000 |
|---|---|---|
| committer | Tomas V.V.Cox <cox@php.net> | 2002-03-23 16:50:43 +0000 |
| commit | f40007a1efc3d3c7553d4169ff1f426a478f2450 (patch) | |
| tree | 08cefeb14d30bf7cfea1ca0e68f1f3cacb60950a /pear/PEAR/Frontend/CLI.php | |
| parent | dc17bcc6ab865b4a2cc334fce063d0f08a67323e (diff) | |
| download | php-git-f40007a1efc3d3c7553d4169ff1f426a478f2450.tar.gz | |
- 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
Diffstat (limited to 'pear/PEAR/Frontend/CLI.php')
| -rw-r--r-- | pear/PEAR/Frontend/CLI.php | 14 |
1 files 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 <ssb@fast.no> | +----------------------------------------------------------------------+ - $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; |
