Skip to content

Commit

Permalink
Use Console_Color2 to prevent E_NOTICES
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske committed Jan 27, 2014
1 parent e865ecf commit bf5021f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Console_Table
/**
* Whether the data has ANSI colors.
*
* @var boolean
* @var Console_Color2
*/
var $_ansiColor = false;

Expand All @@ -176,9 +176,9 @@ function Console_Table($align = CONSOLE_TABLE_ALIGN_LEFT,
$this->_defaultAlign = $align;
$this->_border = $border;
$this->_padding = $padding;
$this->_ansiColor = $color;
if ($this->_ansiColor) {
include_once 'Console/Color.php';
if ($color) {
include_once 'Console/Color2.php';
$this->_ansiColor = new Console_Color2();
}
if (!empty($charset)) {
$this->setCharset($charset);
Expand Down Expand Up @@ -781,7 +781,7 @@ function _strlen($str)

// Strip ANSI color codes if requested.
if ($this->_ansiColor) {
$str = Console_Color::strip($str);
$str = $this->_ansiColor->strip($str);
}

// Cache expensive function_exists() calls.
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Use line breaks dependent on the current operating system.
</required>
<optional>
<package>
<name>Console_Color</name>
<name>Console_Color2</name>
<channel>pear.php.net</channel>
<min>0.0.4</min>
<min>0.1.2</min>
</package>
</optional>
</dependencies>
Expand Down

0 comments on commit bf5021f

Please sign in to comment.