1<?php
2
3ini_set('memory_limit','128M');
4
5if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../');
6define('NOSESSION',true);
7require_once(DOKU_INC.'inc/init.php');
8
9session_write_close();
10
11// Get the syntax parameters
12$data = $_REQUEST;
13
14// Get the plugin
15$plugin = plugin_load('syntax','mindmap');
16
17$image = $plugin->get_graphviz_image( $data );
18
19if (!$image) _fail();
20
21header('Content-Type: image/png;');
22header('Expires: '.gmdate("D, d M Y H:i:s", time()+max($conf['cachetime'], 3600)).' GMT');
23header('Cache-Control: public, proxy-revalidate, no-transform, max-age='.max($conf['cachetime'], 3600));
24header('Pragma: public');
25http_conditionalRequest($time);
26echo $image;
27
28
29function _fail() {
30    header("HTTP/1.0 404 Not Found");
31    header('Content-Type: image/png');
32    echo io_readFile('broken.png',false);
33    exit;
34}
35
36?>