svn: /phd/trunk/phpdotnet/phd/Package/PHP/ BigXHTML.php

From: Date: Mon, 10 Aug 2009 16:33:24 +0000
Subject: svn: /phd/trunk/phpdotnet/phd/Package/PHP/ BigXHTML.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4640@lists.php.net to get a copy of this message
moacir Mon, 10 Aug 2009 16:33:24 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=287046 Log: extracting methods for testing Changed paths: U phd/trunk/phpdotnet/phd/Package/PHP/BigXHTML.php Modified: phd/trunk/phpdotnet/phd/Package/PHP/BigXHTML.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/PHP/BigXHTML.php 2009-08-10 16:29:41 UTC (rev 287045) +++ phd/trunk/phpdotnet/phd/Package/PHP/BigXHTML.php 2009-08-10 16:33:24 UTC (rev 287046) @@ -6,6 +6,7 @@ public function __construct() { parent::__construct(); $this->registerFormatName("PHP-BigXHTML"); + $this->setTitle("PHP Manual"); $this->setChunked(false); } @@ -18,7 +19,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> - <title>$this->getTitle()</title> + <title>{$this->getTitle()}</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> @@ -30,10 +31,23 @@ } public function close() { - fwrite($this->getFileStream(), $this->footer(true)); - fclose($this->getFileStream()); + if ($this->getFileStream()) { + fwrite($this->getFileStream(), $this->footer(true)); + fclose($this->getFileStream()); + } } + public function createFileName() { + return Config::output_dir() . strtolower($this->getFormatName()) . '.' . $this->getExt(); + } + + public function createOutputFile() { + if (!is_resource($this->getFileStream())) { + $this->setFileStream(fopen($this->createFileName(), "w+")); + fwrite($this->getFileStream(), $this->header()); + } + } + public function appendData($data) { if ($this->appendToBuffer) { $this->buffer .= $data; @@ -67,11 +81,7 @@ case Render::INIT: if ($val) { - if (!is_resource($this->getFileStream())) { - $filename = Config::output_dir() . strtolower($this->getFormatName()) . '.' . $this->getExt(); - $this->setFileStream(fopen($filename, "w+")); - fwrite($this->getFileStream(), $this->header()); - } + $this->createOutputFile(); } break;

« previous php.doc.cvs (#4640) next »