00001 <?php 00002 /*************************************************************************** 00003 * Copyright (C) 2006-2007 by Konstantin V. Arkhipov * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Lesser General Public License as * 00007 * published by the Free Software Foundation; either version 3 of the * 00008 * License, or (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 /* $Id: ColoredTextOutput.class.php 4687 2007-12-09 18:57:18Z voxus $ */ 00012 00016 final class ColoredTextOutput extends TextOutput 00017 { 00021 public function setMode( 00022 $attribute = ConsoleMode::ATTR_RESET_ALL, 00023 $foreground = ConsoleMode::FG_WHITE, 00024 $background = ConsoleMode::BG_BLACK 00025 ) 00026 { 00027 echo 00028 chr(0x1B) 00029 .'['.$attribute.';' 00030 .$foreground.';' 00031 .$background.'m'; 00032 00033 return $this; 00034 } 00035 00039 public function resetAll() 00040 { 00041 echo chr(0x1B).'[0m'; 00042 00043 return $this; 00044 } 00045 } 00046 ?>