adapt to console_table 1.2.0
[bdrem.git] / src / bdrem / Renderer / Console.php
index fc2174f72b73964c6a3c5761880a330dac30a92d..e88d57ae537990dd0cb818bfc3995bbe3d786976 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 namespace bdrem;
 
-class Renderer_Console
+class Renderer_Console extends Renderer
 {
+    protected $httpContentType = 'text/plain; charset=utf-8';
+
     /**
      * Use ANSI color codes for output coloring
      *
@@ -17,13 +19,14 @@ class Renderer_Console
 
     public function render($arEvents)
     {
+        $this->loadConfig();
         if ($this->ansi) {
             $this->cc = new \Console_Color2();
         }
 
         $tbl = new \Console_Table(
             CONSOLE_TABLE_ALIGN_LEFT,
-            array('sect' => '', 'rule' => '-', 'vert' => ''),
+            array('intersection' => '', 'horizontal' => '-', 'vertical' => ''),
             1, null, $this->ansi
         );
         $tbl->setAlign(0, CONSOLE_TABLE_ALIGN_RIGHT);
@@ -80,5 +83,12 @@ class Renderer_Console
         }
         return $data;
     }
+
+    protected function loadConfig()
+    {
+        if (isset($this->config->ansi)) {
+            $this->ansi = $this->config->ansi;
+        }
+    }
 }
 ?>