summaryrefslogtreecommitdiffstats
path: root/codebase/Output/OutputWriter.php
diff options
context:
space:
mode:
Diffstat (limited to 'codebase/Output/OutputWriter.php')
-rw-r--r--codebase/Output/OutputWriter.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/codebase/Output/OutputWriter.php b/codebase/Output/OutputWriter.php
new file mode 100644
index 0000000..96bb49a
--- /dev/null
+++ b/codebase/Output/OutputWriter.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace DHTMLX\Connector\Output;
+
+class OutputWriter{
+ private $start;
+ private $end;
+ private $type;
+
+ public function __construct($start, $end = ""){
+ $this->start = $start;
+ $this->end = $end;
+ $this->type = "xml";
+ }
+ public function add($add){
+ $this->start.=$add;
+ }
+ public function reset(){
+ $this->start="";
+ $this->end="";
+ }
+ public function set_type($add){
+ $this->type=$add;
+ }
+ public function output($name="", $inline=true, $encoding=""){
+ ob_clean();
+
+ if ($this->type == "xml"){
+ $header = "Content-type: text/xml";
+ if ("" != $encoding)
+ $header.="; charset=".$encoding;
+ header($header);
+ }
+
+ echo $this->__toString();
+ }
+ public function __toString(){
+ return $this->start.$this->end;
+ }
+} \ No newline at end of file