svn: /phd/trunk/phpdotnet/phd/Package/IDE/ Funclist.php
| From: | Moacir de Oliveira Miranda Júnior | Date: | Tue, 01 Sep 2009 01:14:26 +0000 |
| Subject: | svn: /phd/trunk/phpdotnet/phd/Package/IDE/ Funclist.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4810@lists.php.net to get a copy of this message | ||
moacir Tue, 01 Sep 2009 01:14:26 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287932
Log:
using a string buffer instead of fopen and fwrite
Changed paths:
U phd/trunk/phpdotnet/phd/Package/IDE/Funclist.php
Modified: phd/trunk/phpdotnet/phd/Package/IDE/Funclist.php
===================================================================
--- phd/trunk/phpdotnet/phd/Package/IDE/Funclist.php 2009-09-01 01:10:04 UTC (rev 287931)
+++ phd/trunk/phpdotnet/phd/Package/IDE/Funclist.php 2009-09-01 01:14:26 UTC (rev 287932)
@@ -13,6 +13,7 @@
protected $isFunctionRefSet = false;
protected $isRefname = false;
+ protected $buffer = "";
public function __construct() {
$this->registerFormatName("IDE-Funclist");
@@ -26,8 +27,8 @@
public function transformFromMap($open, $tag, $name, $attrs, $props) {}
public function appendData($data) {
- if ($this->isFunctionRefSet && $this->isRefname) {
- fwrite($this->getFileStream(), $data ? $data . "\n" : "");
+ if ($data && $this->isFunctionRefSet && $this->isRefname) {
+ $this->buffer .= $data . "\n";
}
}
@@ -37,17 +38,10 @@
$this->registerElementMap($this->elementmap);
$this->registerTextMap($this->textmap);
break;
- case Render::INIT:
- if ($value) {
- if (!is_resource($this->getFileStream())) {
- $filename = Config::output_dir() . strtolower($this->getFormatName()) .
'.' . $this->getExt();
- $this->setFileStream(fopen($filename, "w+"));
- }
- }
+ case Render::FINALIZE:
+ $filename = Config::output_dir() . strtolower($this->getFormatName()) .
'.' . $this->getExt();
+ file_put_contents($filename, $this->buffer);
break;
- case Render::FINALIZE:
- fclose($this->getFileStream());
- break;
case Render::VERBOSE:
v("Starting %s rendering", $this->getFormatName(),
VERBOSE_FORMAT_RENDERING);
break;