cvs: phd / package.xml /themes/php phpweb.php
| From: | Hannes Magnusson | Date: | Sat, 26 Jan 2008 13:04:56 +0000 |
| Subject: | cvs: phd / package.xml /themes/php phpweb.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1082@lists.php.net to get a copy of this message | ||
bjori Sat Jan 26 13:04:56 2008 UTC
Modified files:
/phd package.xml
/phd/themes/php phpweb.php
Log:
Fixed bug#43904 (PhD doesn't detect <section> without xml:id)
http://cvs.php.net/viewvc.cgi/phd/package.xml?r1=1.28&r2=1.29&diff_format=u
Index: phd/package.xml
diff -u phd/package.xml:1.28 phd/package.xml:1.29
--- phd/package.xml:1.28 Fri Jan 11 19:55:01 2008
+++ phd/package.xml Sat Jan 26 13:04:56 2008
@@ -26,6 +26,7 @@
<notes>
- Removed support for phnotify
- Fixed E_NOTICE on empty references
+ - Fixed bug#43904 (PhD doesn't detect <section> without xml:id)
- Fixed bug#43489 (Class synopsis return types are not links)
- Fixed bug#43440 (Wrong encoding on some parts of the page)
- Fixed bug#43428 (Empty TOC)
http://cvs.php.net/viewvc.cgi/phd/themes/php/phpweb.php?r1=1.20&r2=1.21&diff_format=u
Index: phd/themes/php/phpweb.php
diff -u phd/themes/php/phpweb.php:1.20 phd/themes/php/phpweb.php:1.21
--- phd/themes/php/phpweb.php:1.20 Mon Dec 31 11:49:00 2007
+++ phd/themes/php/phpweb.php Sat Jan 26 13:04:56 2008
@@ -1,5 +1,5 @@
<?php
-/* $Id: phpweb.php,v 1.20 2007/12/31 11:49:00 bjori Exp $ */
+/* $Id: phpweb.php,v 1.21 2008/01/26 13:04:56 bjori Exp $ */
require_once $ROOT . '/themes/php/phpdotnet.php';
class phpweb extends phpdotnet {
@@ -14,10 +14,24 @@
}
public function writeChunk($id, $stream) {
rewind($stream);
- $filename = $this->ext."/$id.".$this->ext;
+
+ // Create random filename when the chunk doesn't have an ID
+ if ($id === null) {
+ $filename = tempnam($this->ext, "phd");
+ if(rename($filename, $filename. "." . $this->ext)) {
+ $filename .= "." .$this->ext;
+ } else {
+ throw new Exception("Cannot rename $filename to
$filename.{$this->ext}");
+ }
+ v("WARNING: Chunk without an ID found, TOC will NOT work. Wrote content to
$filename.\n");
+ } else {
+ $filename = $this->ext."/$id.".$this->ext;
+ }
+
file_put_contents($filename, $this->header($id));
file_put_contents($filename, $stream, FILE_APPEND);
file_put_contents($filename, $this->footer($id), FILE_APPEND);
+
if ($GLOBALS["OPTIONS"]["verbose"] & VERBOSE_CHUNK_WRITING) {
v("Wrote %s\n", $filename);
}
@@ -26,10 +40,13 @@
switch($isChunk) {
case PhDReader::CLOSE_CHUNK:
$id = $this->CURRENT_ID;
+
$stream = array_pop($this->streams);
$retval = fwrite($stream, $data);
$this->writeChunk($id, $stream);
fclose($stream);
+
+ $this->CURRENT_ID = null;
return $retval;
break;