1 | <?php |
||
28 | class HtmlOutputFormatter implements OutputFormatterInterface { |
||
29 | |||
30 | const PATTERN = "/\[(([\d+];?)*)m(.*?)\[(([\d+];?)*)m/i"; |
||
31 | |||
32 | static private $styles = array( |
||
33 | '30' => 'color:rgba(0,0,0,1)', |
||
34 | '31' => 'color:rgba(230,50,50,1)', |
||
35 | '32' => 'color:rgba(50,230,50,1)', |
||
36 | '33' => 'color:rgba(230,230,50,1)', |
||
37 | '34' => 'color:rgba(50,50,230,1)', |
||
38 | '35' => 'color:rgba(230,50,150,1)', |
||
39 | '36' => 'color:rgba(50,230,230,1)', |
||
40 | '37' => 'color:rgba(250,250,250,1)', |
||
41 | '40' => 'color:rgba(0,0,0,1)', |
||
42 | '41' => 'background-color:rgba(230,50,50,1)', |
||
43 | '42' => 'background-color:rgba(50,230,50,1)', |
||
44 | '43' => 'background-color:rgba(230,230,50,1)', |
||
45 | '44' => 'background-color:rgba(50,50,230,1)', |
||
46 | '45' => 'background-color:rgba(230,50,150,1)', |
||
47 | '46' => 'background-color:rgba(50,230,230,1)', |
||
48 | '47' => 'background-color:rgba(250,250,250,1)', |
||
49 | '1' => 'font-weight:bold', |
||
50 | '4' => 'text-decoration:underline', |
||
51 | '8' => 'visibility:hidden', |
||
52 | ); |
||
53 | private $formatter; |
||
54 | |||
55 | public function __construct($formatter){ |
||
58 | |||
59 | public function setDecorated($decorated){ |
||
62 | |||
63 | public function isDecorated(){ |
||
66 | |||
67 | public function setStyle($name, OutputFormatterStyleInterface $style){ |
||
70 | |||
71 | public function hasStyle($name){ |
||
74 | |||
75 | public function getStyle($name){ |
||
78 | |||
79 | public function format($message){ |
||
86 | |||
87 | protected function replaceFormat($matches){ |
||
100 | |||
101 | } |
||
102 |