array( "close" => false, "classname" => false, ), "classsynopsisinfo" => array( "implements" => false, "ooclass" => false, ), "examples" => 0, "fieldsynopsis" => array( "modifier" => "public", ), "co" => 0, "callouts" => 0, "segmentedlist" => array( "seglistitem" => 0, "segtitle" => array( ), ), "table" => false, "procedure" => false, "mediaobject" => array( "alt" => false, ), "footnote" => array( ), "tablefootnotes" => array( ), ); public function __construct() { parent::__construct(); parent::registerFormatName($this->formatname); } public abstract function header($id); public abstract function footer($id); public function transformFromMap($open, $tag, $name, $attrs, $props) { if ($open) { $idstr = ""; if (isset($attrs[Reader::XMLNS_XML]["id"])) { $id = $attrs[Reader::XMLNS_XML]["id"]; $idstr = ' id="' .$id. '" name="' .$id. '"'; } return '<' .$tag. ' class="' .$name. '"' . $idstr . ($props["empty"] ? '/' : "") . '>'; } return '' .$tag. '>'; } public function appendData($data) { if ($this->appendToBuffer) { $this->buffer .= $data; return; } elseif ($this->flags & Render::CLOSE) { $fp = array_pop($this->fp); fwrite($fp, $data); $this->writeChunk($this->CURRENT_CHUNK, $fp); fclose($fp); $this->flags ^= Render::CLOSE; } elseif ($this->flags & Render::OPEN) { $this->fp[] = $fp = fopen("php://temp/maxmemory", "r+"); fwrite($fp, $data); $this->flags ^= Render::OPEN; } else { $fp = end($this->fp); fwrite($fp, $data); } } public function writeChunk($id, $fp) { $filename = $this->outputdir . $id . '.' .$this->ext; rewind($fp); file_put_contents($filename, $this->header($id)); file_put_contents($filename, $fp, FILE_APPEND); file_put_contents($filename, $this->footer($id), FILE_APPEND); } public function close() { foreach ($this->fp as $fp) { fclose($fp); } } public function createLink($for, &$desc = null, $type = Format::SDESC) { $retval = null; if (isset($this->indexes[$for])) { $rsl = $this->indexes[$for]; $retval = $rsl["filename"] . "." . $this->ext . '#' . $rsl["docbook_id"]; $desc = $rsl["sdesc"] ?: $rsl["ldesc"]; } return $retval; } public function TEXT($str) { return htmlspecialchars($str, ENT_QUOTES, "UTF-8"); } public function CDATA($str) { switch($this->role) { case "php": return '
' .(htmlspecialchars($str, ENT_QUOTES, "UTF-8")). '