Skip to content
Snippets Groups Projects
Commit 85767031 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

header support for renderer plugins

Renderer plugins now can store HTTP header information in 'format <mode>' which
will be used to send their output. Also fixes a problem with loading cache files.

darcs-hash:20071016185626-7ad00-c0e18a90b310daf0d3a3c01d7a73f3524ced803d.gz
parent 014d0ab6
No related branches found
No related tags found
No related merge requests found
......@@ -408,7 +408,11 @@ function act_export($act){
// try to run renderer
$mode = substr($act,7);
$text = p_cached_output(wikiFN($ID,$REV), $mode);
$headers = p_get_metadata($ID,"format $mode");
if(!is_null($text)){
if(is_array($headers)) foreach($headers as $key => $val){
header("$key: $val");
}
print $text;
exit;
}
......
......@@ -147,7 +147,7 @@ function p_cached_output($file, $format='xhtml', $id='') {
$cache = new cache_renderer($id, $file, $format);
if ($cache->useCache()) {
$parsed = $cache->retrieveCache();
$parsed = $cache->retrieveCache(false);
if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- cachefile {$cache->cache} used -->\n";
} else {
$parsed = p_render($format, p_cached_instructions($file,false,$id), $info);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment