From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:16:56
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9554/lib Modified Files: RssWriter.php Log Message: Modified semantics. RssWriter now writes its output directly (like ZipWriter) rather than returning it in a string. Index: RssWriter.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/RssWriter.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** RssWriter.php 2001/12/07 22:15:43 1.1 --- RssWriter.php 2001/12/14 20:16:53 1.2 *************** *** 115,118 **** --- 115,120 ---- }; + // Encoding for RSS output. + define('RSS_ENCODING', 'ISO-8859-1'); /** *************** *** 168,172 **** // 'description', 'URI' function addItem($properties, $uri = false) { ! $this->_items[] = $this->__node('item', $properties, $uri); } --- 170,174 ---- // 'description', 'URI' function addItem($properties, $uri = false) { ! $this->_items[] = $this->__node('item', $properties, $uri); } *************** *** 177,181 **** function image($properties, $uri = false) { $this->_image = $this->__node('image', $properties, $uri); - } --- 179,182 ---- *************** *** 218,232 **** $this->add($items); $this->_finished = true; } /** ! * Get XML representation of RSS. */ ! function asXML () { ! $this->finish(); ! return $this->asString(); } ! /** * Create a new RDF <i>typedNode</i>. --- 219,237 ---- $this->add($items); + $this->__spew(); $this->_finished = true; } + /** ! * Write output to HTTP client. */ ! function __spew() { ! header("Content-Type: application/xml; charset=" . RSS_ENCODING); ! printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); ! echo $this->asString(); } ! ! /** * Create a new RDF <i>typedNode</i>. |