svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/ChunkedXHTML.php

From: Date: Tue, 28 Jul 2009 05:42:02 +0000
Subject: svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/ChunkedXHTML.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4535@lists.php.net to get a copy of this message
moacir Tue, 28 Jul 2009 05:42:02 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=286440 Log: dbhtml filename support Changed paths: U phd/trunk/phpdotnet/phd/Index.php U phd/trunk/phpdotnet/phd/Package/Default/ChunkedXHTML.php Modified: phd/trunk/phpdotnet/phd/Index.php =================================================================== --- phd/trunk/phpdotnet/phd/Index.php 2009-07-28 05:40:25 UTC (rev 286439) +++ phd/trunk/phpdotnet/phd/Index.php 2009-07-28 05:42:02 UTC (rev 286440) @@ -70,6 +70,9 @@ ); private $mytextmap = array( ); + private $pihandlers = array( + 'dbhtml' => 'PI_DBHTMLHandler', + ); private $chunks = array(); private $isChunk = array(); private $previousId = ""; @@ -110,6 +113,7 @@ if ($value) { $this->registerElementMap(static::getDefaultElementMap()); $this->registerTextMap(static::getDefaultTextMap()); + $this->registerPIHandlers($this->pihandlers); } break; case Render::INIT: @@ -291,12 +295,16 @@ return false; } if (array_pop($this->isChunk)) { - array_pop($this->chunks); + $lastchunk = array_pop($this->chunks); $this->currentchunk = end($this->chunks); + $dbhtml = $this->getPIHandler("dbhtml"); + if ($dbhtml->getAttribute("filename")) { + $this->nfo[$lastchunk]["filename"] = $dbhtml->getAttribute("filename"); + $dbhtml->setAttribute("filename", false); + } $this->appendID(); $this->notify(Render::CHUNK, Render::CLOSE); } - return false; } public function format_legalnotice_chunk($open, $name, $attrs, $props) { Modified: phd/trunk/phpdotnet/phd/Package/Default/ChunkedXHTML.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/Default/ChunkedXHTML.php 2009-07-28 05:40:25 UTC (rev 286439) +++ phd/trunk/phpdotnet/phd/Package/Default/ChunkedXHTML.php 2009-07-28 05:42:02 UTC (rev 286440) @@ -38,7 +38,13 @@ } public function writeChunk($id, $fp) { - $filename = $this->getOutputDir() . $id . '.' . $this->getExt(); + $dbhtml = $this->getPIHandler("dbhtml"); + if ($dbhtml->getAttribute("filename")) { + $filename = $this->getOutputDir() . $dbhtml->getAttribute("filename") . "." . $this->getExt(); + $dbhtml->setAttribute("filename", false); + } else { + $filename = $this->getOutputDir() . $id . '.' . $this->getExt(); + } rewind($fp); file_put_contents($filename, $this->header($id));

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