... and many thanks for the additional hints. Will surely come handy as
the aim is to be able to use the endpoint for (batchlike) RDF export too.
Samuel
On 06/29/2010 03:07 AM, Brion Vibber wrote:
You should always be sure to set the content-type
correctly; and if
outputting XML or HTML, be sure to include a charset header.
The wfResetOutputBuffers() bit isn't required in most cases, but if you're
outputting a*lot* of data it can help to let you stream output directly to
the downloader. (By default, buffering is used to apply gzip encoding and
send a Content-Size header. This is usually good, but means that all your
output has to be built and stored in memory before it actually gets sent to
the client... potentially a problem if you're streaming out fifty thousand
revisions of [[Hurricane Katrina]]!)
When you're doing your raw output, you can go ahead and do 'print' or
'echo'
directly if you like -- you're now in control.;)
As a general note -- always be careful of your output to make sure you're
applying proper escaping when generating HTML or XML; raw output can be a
security risk if input isn't sanitized properly.
--
Samuel Lampa
---------------------------------------
Biotech Student @ Uppsala University
GSoC Student @ Semantic MediaWiki
---------------------------------------
E-mail:
samuel.lampa[at]gmail.com
Mobile: +46 (0)70-2073732
Blog:
http://saml.rilspace.org
Twitter:
http://twitter.com/samuellampa
---------------------------------------