1<?php 2/** 3 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 4 * @author Andreas Gohr <andi@splitbrain.org> 5 */ 6 7if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../'); 8define('NOSESSION',true); 9require_once(DOKU_INC.'inc/init.php'); 10 11// let the syntax plugin do the work 12$data = $_REQUEST; 13$plugin = plugin_load('syntax','graphviz'); 14$cache = $plugin->_imgfile($data); 15if(!$cache) _fail(); 16 17header('Content-Type: image/png;'); 18header('Expires: '.gmdate("D, d M Y H:i:s", time()+max($conf['cachetime'], 3600)).' GMT'); 19header('Cache-Control: public, proxy-revalidate, no-transform, max-age='.max($conf['cachetime'], 3600)); 20header('Pragma: public'); 21http_conditionalRequest($time); 22echo io_readFile($cache,false); 23 24 25function _fail(){ 26 header("HTTP/1.0 404 Not Found"); 27 header('Content-Type: image/png'); 28 echo io_readFile('broken.png',false); 29 exit; 30} 31 32//Setup VIM: ex: et ts=4 enc=utf-8 : 33